Variable length coding method and variable length decoding method

ABSTRACT

An image coding apparatus provides a run-length encoding unit RLE 1  that subjects quantized coefficients which are obtained by quantizing frequency components of an image signal to a variable length coding process by using a run value Run that indicates the number of successive zero coefficients and a level value Lev that indicates a value of a non-zero coefficient following the zero coefficients. The run-length encoding unit RLE 1  includes a reordering unit Lreodr for reordering level values Lev; a variable length coder LVLC for coding reordered level values ROLev by using a code table that is selected according to the value of a quantization parameter QP; a reordering unit Rreodr for reordering run values Run from high frequency component of the quantized coefficients to low frequency component; and a variable length coder RVLC for coding reordered run values RORun by using a code table that is selected according to the number of already-processed run values.

This application is a divisional application of U.S. patent applicationSer. No. 11/110,921, filed Apr. 21, 2005 is now a U.S. Pat. No.6,992,605, which is a divisional application of U.S. patent applicationSer. No. 10/480,038, filed Dec. 9, 2003 is now a U.S. Pat. No.6,967,600, which is the National Stage of International Application No.PCT/JP02/12230, filed Nov. 22, 2002.

TECHNICAL FIELD

The present invention relates to a variable length coding method and avariable length decoding method and, more particularly, to a method forconverting plural coefficients which are obtained by quantizingfrequency components of image data (quantization coefficients) intocoded data according to a variable length coding process, and a methodfor decoding the coded data according to a variable length decodingprocess to reconstitute plural coefficients.

BACKGROUND ART

In recent years, we have entered the age of multimedia in which audio,video and other data are integrally handled, and conventionalinformation media (i.e., means for transmitting information to persons),such as newspapers, magazines, televisions, radios, and telephones havebeen adopted as subjects of multimedia. Generally, “multimedia” means torepresent not only characters but also diagrams, speech and especiallyimages simultaneously in relation with each other. In order to handlethe conventional information media as the subjects of multimedia, it isessential to transform the information into digital format.

When the quantity of data processed by each information medium describedabove is estimated as the quantity of digital data, in the case ofcharacters, the data quantity for each character is 1˜2 bytes. However,in the case of speech, the data quantity is 64 kbits per second (qualityfor telecommunication) and, in the case of moving pictures, it is morethan 100 Mbits per second (quality for current television broadcasting).So, as for the information media described above, it is not practical tohandle such massive data as it is in the digital format. For example,visual telephones have already been put to practical use by ISDN(Integrated Services Digital Network) having a transmission rate of 64kbps˜1.5 Mbps, but it is impossible to transmit an output image of atelevision camera having a large quantity of data as it is by the ISDN.

So, data compression technologies are demanded. For example in the caseof visual telephones, the moving picture compression technologiesstandardized as H.261 and H.263 by ITU-T (InternationalTelecommunication Union-Telecommunication Sector) are employed. Further,according to the data compression technology based on MPEG-1, it ispossible to record image data, together with audio data, in an ordinarymusic CD (compact disk).

Here, MPEG (Moving Picture Experts Group) is an international standardassociated with digital compression for image signals of movingpictures. In MPEG-1, an image signal of a moving picture is compressedto 1.5 Mbps, i.e., data of a television signal is compressed to about1/100 of the original signal. Since the transmission rate to whichMPEG-1is directed is mainly restricted to about 1.5 Mbps, MPEG-2 isstandardized to meet the demands for higher image quality. In MPEG-2, animage signal of a moving picture is compressed to 2˜15 Mbps.

Under the existing circumstances, standardization of MPEG-4 having ahigher compression rate has been realized by the working group for thestandardization of MPEG-1 and MPEG-2 (ISO/IEC JTC1/SC29/WG11). MPEG-4not only enables coding at a low bit rate with high efficiency but alsorealizes introduction of a strong error resistant technology that canreduce a subjective deterioration of image quality even when atransmission line error occurs. Further, ITU-T is developingstandardization of H.26L as an image coding method of the nextgeneration, and the latest coding method at this point of time is amethod called “Test Model 8” (TML8)

FIG. 30 is a block diagram illustrating a conventional image codingapparatus.

This image coding apparatus 201 a has a blocking unit Blk for blockingan inputted image signal Vin into unit areas (blocks) each comprising apredetermined number of pixels and outputting a blocked image signalBlkS, and a frequency transformation unit Trans for subjecting theoutput BlkS to frequency transformation to output frequency componentsTransS corresponding to respective blocks. Here, the block is an area ofa predetermined size in a picture (image space), which is a unit for acoding process of an image signal, and it is composed of a predeterminednumber of pixels. Here, the image signal Vin corresponds to a movingimage that is composed of plural pictures.

The image coding apparatus 201 a further includes a quantization unit Qfor quantizing the outputs (frequency components) TransS from thefrequency transformation unit and outputting quantized components(quantization coefficients) QS corresponding to respective blocks, and acoding unit RLE0 a for subjecting the outputs (quantized components) Qsfrom the quantization unit to a variable length coding process.

Next, its operation will be described.

When an image signal Vin is inputted to the image coding apparatus 201a, the blocking unit Blk divides the inputted image signal Vin intoimage signals corresponding to block units, to generate an image signal(blocked image signal) BlkS corresponding to each block. The frequencytransformation unit Trans transforms the blocked image signal BlkS intofrequency components TransS according to DCT (Discrete CosineTransformation) or Wavelet transformation. The quantization unit Qquantizes the frequency components TransS in a predeterminedquantization step on the basis of a quantization parameter QP to outputquantized components QS, as well as outputs the quantization parameterQP. Then, the coding unit RLE0 a subjects the quantized components QS toa variable length coding process, and outputs a coded steam Str0 a.

FIG. 31 is a block diagram for explaining the coding unit RLE0 a thatconstitutes the image coding apparatus 201 a.

This coding unit RLE0 a has a zigzag scanner Scan for transforming theoutputs (quantized components) QS of the quantization unit Q in atwo-dimensional array into quantized component Coef in a one-dimensionalarray (i.e., predetermined order), and a variable length coder VLC forsubjecting the quantized components Coef outputted from the zigzagscanner Scan to a variable length coding process.

When the quantized components QS outputted from the quantization unit Qare inputted to the coding unit RLE0 a, the zigzag scanner Scantransforms the quantized components QS in a two-dimensional array fromthe quantization unit Q into quantized components Coef in aone-dimensional array (predetermined order), and outputs the quantizedcomponents.

FIG. 43 is a diagram for specifically explaining the process fortransforming the quantized components QS by the zigzag scanner Scan.

As shown in FIG. 43, the quantized components QS outputted from thequantization unit Q have a two-dimensional array, i.e., an array inwhich the quantized components QS are arranged in the form of a matrixon a two-dimensional frequency region Fr according to the height of thehorizontal frequency component and the height of the vertical frequencycomponent.

The zigzag scanner Scan carries out a process for scanning the quantizedcomponents QS in the two-dimensional array in a zigzag manner as shownby arrows Y1 to Y7, to transform the components into quantizedcomponents Coef in a one-dimensional array. That is, in this scanprocess, a predetermined order along the scanning course is set withrespect to the plural quantized components QS in the two-dimensionalarray.

Then, the variable length coder VLC assigns codes to the quantizedcomponents Coef which are outputted from the zigzag scanner Scan, withusing a code table that shows a correlation between numerical valuesindicating the sizes of the quantized components and codes (code words),to transform the quantized components into a coded stream Str0 acorresponding to each block.

FIG. 32 is a block diagram for explaining an image decoding apparatus202 a corresponding to the image coding apparatus 201 a as shown in FIG.30.

This image decoding apparatus 202 a decodes the coded stream Str0 awhich is outputted from the conventional image coding apparatus 201 a asshown in FIG. 30.

The image decoding apparatus 202 a has a decoding unit RLD0 a fordecoding the coded stream Str0 a which is outputted from the imagecoding apparatus 201 a, and an inverse quantization unit IQ forsubjecting outputs (decoded quantization components) DQS from thedecoding unit RLD0 a to an inverse quantization process.

The image decoding apparatus 202 a further includes an inverse frequencytransformation unit ITrans for subjecting outputs (decoded frequencycomponents) ITransS from the inverse quantization unit IQ to an inversefrequency transformation process, and a deblocking unit Deblk forgenerating a decoded image signal Vout corresponding to each picture onthe basis of outputs (decoded blocked image signals) DBlkS from theinverse frequency transformation unit ITrans.

Next, its operation will be described.

When the coded stream Str0 a is inputted from the image coding apparatus201 ato the image decoding apparatus 202 a, the decoding unit RLD0 adecodes the coded stream Str0 a and outputs decoded quantized componentsDQS. The operation of the decoding unit RLD0 a is the inverse of theoperation of the coding unit RLE0 a.

The inverse quantization unit IQ carries out the inverse of theoperation of the quantization unit Q, i.e., an operation of inverselyquantizing the decoded quantized components DQS with referring to thequantization parameter QP, and outputs decoded frequency componentsITransS. The inverse frequency transformation unit ITrans carries outthe inverse of the operation of the frequency transformation unit Trans,i.e., an operation of subjecting the decoded frequency componentsITransS to inverse DCT or inverse wavelet transformation, toreconstitute decoded image signals DBlkS corresponding to respectiveblocks. Then, the deblocking unit DeBlk integrates the decoded imagesignals DBlkS of the respective blocks to output a decoded image signalVout corresponding to each picture (frame).

FIG. 33 is a block diagram for explaining the decoding unit RLD0 a thatconstitutes the image decoding apparatus 202 a.

The decoding unit RLD0 a has a variable length decoder VLD forsubjecting the coded stream Str0 a to a variable length decoding processto decode the quantized component Coef corresponding to each codeincluded in the coded stream Str0 a, and an inverse zigzag scanner IScanfor reconstituting quantized components DQS in a two-dimensional arrayfrom the decoded quantized components Coef in a one-dimensional array,which are outputted from the variable length decoder VLD.

In this decoding unit RLD0 a, the variable length decoder VLD decodesthe coded stream Str0 a according to the inverse operation to thevariable length coder VLC, and outputs quantized components Coefcorresponding to codes (code words). Then, the inverse zigzag scannerIScan carries out the inverse operation to the zigzag scanner Scan, toreconstitute decoded quantized components DQS in a two-dimensional arrayfrom the quantized components Coef in a one-dimensional array, which areoutputted from the variable length decoder VLD, and outputs the decodedquantized components DQS to the inverse quantization unit IQ.

Japanese Published Patent Application No. Hei. 6-311534 discloses amethod in which an image signal is divided into a luminance signal and acolor-difference signal to subject the obtained signals to a variablelength coding process.

The plural quantized components corresponding to respective blocks, towhich the predetermined order has been set, are data including a highredundancy, i.e., data in which plural coefficients whose values arezero (zero coefficients) continue after a coefficient whose value is notzero (non-zero coefficient). To encode such quantized components, amethod in which quantized components are encoded with its redundantinformation being deleted, for example, a run-length encoding method inwhich quantized components are encoded by using a run value thatindicates the number of successive zero coefficients and a level valuethat indicates a value of a non-zero coefficient following the zerocoefficients has been conventionally employed.

Hereinafter, a conventional image coding apparatus using the run-lengthencoding method will be described.

FIG. 34 is a block diagram illustrating a conventional image codingapparatus that carries out the run-length encoding.

This image coding apparatus 201 b includes, in place of the coding unitRLE0 a of the image coding apparatus 201 a shown in FIG. 30, arun-length encoding unit RLE0 b for subjecting outputs (quantizedcomponents) QS from the quantization unit Q to run-length encoding andoutputting a coded stream Str0 b. Other components are the same as thoseof the image coding apparatus 201 a.

The operation of the image coding apparatus 201 b is different from thatof the image coding apparatus 201 a only in the operation of the codingunit RLE0 b.

FIG. 35 is a block diagram illustrating a specific construction of thecoding unit RLE0 b in the image coding apparatus 201 b.

This run-length encoding unit RLE0 b has, like the coding unit RLE0 a, azigzag scanner Scan for transforming outputs (quantized components) QSin a two-dimensional array from the quantization unit Q into quantizedcomponents Coef in a one-dimensional (i.e., a predetermined order).

Then, this run-length encoding unit RLE0 b further includes a runcalculator RunCal for calculating the number of successive quantizedcomponents whose values are zero (zero coefficients) Coef and outputtinga run value Run indicating the number of successive zero coefficients,and a level calculator LevCal for calculating a value of a quantizedcomponent whose value is not zero (non-zero coefficient), following thezero coefficients, and outputting a level value Lev indicating the valueof the non-zero coefficient.

The run-length encoding unit RLE0 b further includes a variable lengthcoder LevVLC for subjecting the level value Lev that is outputted fromthe level calculator LevCal to a variable length coding process andoutputting a code string (level value code string) LStr, a variablelength coder RunVLC for subjecting the run value Run that is outputtedfrom the run calculator RunCal to a variable length coding process andoutputting a code string (run value code string) RStr, and a multiplexerMUX for multiplexing the level value code string LStr and the run valuecode string RStr for each block and outputting a multiplexed codedstream Str0 b.

Next, its operation will be described.

The zigzag scanner Scan transforms the quantized components QS in atwo-dimensional array, which are outputted from the quantization unit Q,into quantized components Coef in a one-dimensional array (predeterminedorder), and outputs the quantized components Coef. The transformationprocess for the quantized components Qs by the zigzag scanner Scan iscarried out in the same manner as that in the coding unit RLE0 a of theimage coding apparatus 201 a.

The run calculator RunCal calculates the number of successive zerocoefficients on the basis of the quantized components Coef which areoutputted from the zigzag scanner Scan, and outputs a run value Runindicating the calculated number. The level calculator LevCal calculatesa value of a non-zero coefficient that follows the successive zerocoefficients, on the basis of the quantized components Coef outputtedfrom the zigzag scanner Scan, and outputs a level value Lev indicatingthis value.

Here, the run calculator RunCal generates a special value EOB (End ofBlock) when detecting the highest frequency component (the last non-zerocoefficient) in the target block to be processed, to inform thatsubsequent higher frequency components have all zero value.

Further, the variable length coder RunVLC subjects the run value Runwhich is outputted from the run calculator RunCal to a variable lengthcoding process for assigning a code (code word) to the run valueaccording to a code table or arithmetic operation, and outputs a codestring RStr. The variable length coder LevVLC subjects the level valueLev which is outputted from the level calculator LevCal to a variablelength coding process for assigning a code (code word) to the levelvalue according to a code table or arithmetic operation, and outputs acode string LStr.

The multiplexer MUX multiplexes the code string LStr and the code stringRStr for each block, and outputs a multiplexed coded stream Str0 b.

Here, the process for multiplexing the code string LStr and the codestring RStr is carried out for each block, for example, in such mannerthat the code string RStr corresponding to all run values for a targetblock is followed by the code string LStr corresponding to all levelvalues for the target block, or the code string LStr corresponding toall level values for a target block is followed by the code string RStrcorresponding to all run values for the target block.

The image coding apparatus as described above for encoding pluralquantized coefficients in a predetermined order, by using the run valueRun indicating the number of quantized components whose values are zero(zero coefficients) Coef, and the level value Lev indicating a value ofa quantized component whose value is not zero (non-zero coefficient)Coef, following the zero coefficients, can encode the plural quantizedcoefficients at a higher coding efficiency, while removing its redundantinformation.

FIG. 36 is a block diagram for explaining an image decoding apparatus202 b corresponding to the image coding apparatus 201 b as shown in FIG.34.

This image decoding apparatus 202 b decodes the coded stream Str0 thatis outputted from the conventional image coding apparatus 201 b as shownin FIG. 34.

The image decoding apparatus 202 b has, in place of the decoding unitRLD0 a of the image decoding apparatus 202 a shown in FIG. 32, arun-length decoding unit RLD0 b for subjecting the coded stream Str0 bthat is outputted from the image coding apparatus 201 b to a run-lengthdecoding process. Other components are identical to those of the imagedecoding apparatus 202 a.

The operation of the image decoding apparatus 202 b is different fromthe image decoding apparatus 202 a only in the operation of the decodingunit RLD0 b.

FIG. 37 is a block diagram illustrating a specific construction of therun-length decoding unit RLD0 b in the image decoding apparatus 202 b.

This run-length decoding unit RLD0 b has a demultiplexer DMUX fordemultiplexing the multiplexed coded stream Str0 b that is outputtedfrom the image coding apparatus 201 b to obtain the code string LStrcorresponding to the level values and the code string RStr correspondingto the run values, a variable length decoder LevVLD for subjecting thecode string LStr to a variable length decoding process to reconstitutethe level values Lev, a variable length decoder RunVLC for subjectingthe code string RStr to a variable length decoding process toreconstitute the run values Run, and an inverse zigzag scanner IScan forreconstituting decoded quantized components DQS in a two-dimensionalarray from decoded quantized components in a one-dimensional array,which are represented by the level values Lev and the run values Run.

Next, its operation will be described.

In the image decoding apparatus 202 b, the run-length decoding unit RLD0b carries out the inverse operation to the run-length encoding unit RLE0b. That is, the run-length decoding unit RLD0 b demultiplexes themultiplexed coded stream Str0 b to obtain the code string Lstrcorresponding to the level values and the code string RStr correspondingto the run values.

Then, the variable length decoder LevVLD decodes the code string LStrcorresponding to the level values by the inverse operation to thevariable length coder LevVLC, and outputs the level values Lev. Thevariable length decoder RunVLD decodes the code string RStrcorresponding to the run values by the inverse operation to the variablelength coder RunVLC, and outputs the run values Run.

The inverse zigzag scanner IScan reconstitutes decoded quantizedcomponents DQS in a two-dimensional array from the quantized componentsin a one-dimensional array, which are represented by the level valuesLev and the run values Run, by the inverse operation to the zigzagscanner Scan, and outputs the decoded quantized components to theinverse quantization unit IQ. However, this inverse zigzag scanner IScan(see FIG. 37) is different from the inverse zigzag scanner IScan asshown in FIG. 33 in that the level value Lev and the run value Run areinputted thereto. Thus, the inverse zigzag scanner IScan shown in FIG.37 has a function of converting a coefficient that is represented by thelevel value Lev and the run value Run into a quantized components Coef.

According to the image decoding apparatus that carries out a decodingprocess for decoding plural quantized coefficients in a predeterminedorder, by using the run value Run indicating the number of quantizedcomponents whose values are zero (zero coefficients) Coef and the levelvalue Lev indicating a value of a quantized component whose value is notzero (non-zero coefficient) Coef, following the zeroco efficients, codeddata which is obtained by coding plural quantized components accordingto run-length encoding with removing its redundant information at ahigher coding efficiency is decoded satisfactorily.

Hereinafter, another example of the conventional image coding apparatususing the run-length encoding method will be described.

FIG. 38 is a block diagram illustrating another example of the imagecoding apparatus that employs the conventional run-length encoding unit.Almost all of the conventional image coding apparatuses which arecompliant with standards such as MPEG, or H.261 and H.263 (ITU), or adraft H26L standard (TML8) that is now being planned have a constructionas shown in FIG. 38.

This image coding apparatus 201 c performs coding of quantizedcoefficients using the run value and the level value, like the imagecoding apparatus 201 b shown in FIG. 34, while this image codingapparatus 201 c does not perform a variable length coding process forthe run value and the level value separately like the image codingapparatus 201 b, but performs a variable length coding process for apair of the run value and the level value (run-level pair).

To be more specific, the image coding apparatus 201 c has, like theimage coding apparatus 201 b, a blocking unit Blk to which an imagesignal Vin is inputted, a frequency transformation unit Trans forsubjecting an output BlkS from the blocking unit to frequencytransformation, and a quantization unit Q for quantizing outputs(frequency components) TransS from the transformation unit. The imagecoding apparatus 201 c further includes a run-length encoding unit RLE0c for subjecting outputs (quantized components) QS from the quantizationunit to a run-length encoding process for transforming a run-level paircomprising a run value and a level value into a variable length code.

Next, its operation will be described.

The blocking unit Blk divides the image signal Vin into image signalscorresponding to block units to generate pixel value components (blockedimage signals) BlkS. The frequency transformation unit Trans transformsthe pixel value components BlkS into frequency components TransSaccording to DCT (Discrete Cosine Transformation) or Wavelettransformation. The quantization unit Q quantizes the frequencycomponents TransS on the basis of a quantization parameter QP to outputquantized components QS, as well as outputs the quantization parameterQ. The run-length encoding unit RLE0 c subjects the quantized componentsQS to run-length encoding, and outputs a coded stream Str0 c.

Here, the block is an area of a predetermined size in the picture (imagespace), which is a unit in a coding process for an image signal, andcomposed of a predetermined number of pixels. The run-length encoding isa process for transforming a pair comprising a run value that indicatesthe number of successive quantized components whose values are zero(zero coefficients) and a level value that indicates a value of aquantized component whose value is not zero (non-zero coefficient),following the zero coefficients, into a variable length code, in otherwords, a process for assigning one variable length code (code word) to apair of a run value and a level value (run-level pair).

Next, the run-length encoding unit RLE0 c will be specificallydescribed.

FIG. 39 is a block diagram illustrating a conventional run-lengthencoding unit RLE0 c.

This run-length encoding unit RLE0 c has, like the run-length encodingunit RLE0 b as shown in FIG. 35, a zigzag scanner Scan for transformingthe outputs (quantized components) QS in a two-dimensional array fromthe quantization unit Q, into quantized components Coef in aone-dimensional array (i.e., a predetermined order); a run calculatorRunCal for calculating the number of successive quantized componentswhose values are zero (zero coefficients) Coef and outputting a runvalue Run; and a level calculator LevCal for calculating a value of aquantized component whose value is not zero (non-zero coefficient) Coef,following the zero coefficients, and outputting a level value Lev.

The run-length encoding unit RLE0 c further includes a run-level encoderRunLevEnc for obtaining a code number Code corresponding to a pair ofthe level value Lev and the run value Run according to a code table orarithmetic operation on the basis of the outputs from the run calculatorRunCal and the level calculator LevCal; and a variable length coder VLCfor assigning a code word to the code number Code to generate a codedstream Str0 c corresponding to the image signal Vin.

Next, its operation will be described.

In the run-length encoding unit RLE0 c, like in the run-length encodingunit RLE0 b, the zigzag scanner Scan transforms quantized components QSin a two-dimensional array, which are outputted from the quantizationunit Q, into quantized components Coef in a one-dimensional array(predetermined order), and outputs the obtained quantized components.

FIG. 43 is a diagram for specifically explaining a process fortransforming the quantized components QS by the zigzag scanner Scan.

The quantized components QS outputted from the quantization unit Q havea two-dimensional array as shown in FIG. 43, i.e., an array in which thequantized components QS arranged in the form of matrix on atwo-dimensional frequency region Fr according to the size of thehorizontal frequency component and the size of the vertical frequencycomponent.

The zigzag scanner Scan carries out the process for scanning thequantized components QS in the two-dimensional array in a zigzag manner,as shown by arrows Y1 to Y7, to transform the quantized components QSinto quantized components Coef in a one-dimensional array. That is, thisscanning process sets a predetermined order along the scanning course,with respect to the plural quantized components QS in thetwo-dimensional array.

The run calculator RunCal calculates the number of successive zerocoefficients on the basis of the quantized components Coef outputtedfrom the zigzag scanner Scan, and outputs a run value Run indicating thecalculated number. The level calculator LevCal calculates a value of anon-zero coefficient following the successive zero coefficients, on thebasis of the quantized components Coef outputted from the zigzag scannerScan, and outputs a level value indicating the calculated value. Here,the run calculator RunCal outputs a specific value EOB (End of Block)when detecting the highest frequency component (the last non-zerocoefficient) in a target block to be processed, to inform thatsubsequent higher frequency components have all zero value.

Further, the run-level encoder RunLevEnc obtains a code number Codecorresponding to a pair of the level value Lev and the run value Run onthe basis of the outputs from the run calculator RunCal and the levelcalculator LevCal, according to a code table or arithmetic operation.The variable length coder VLC encodes the code number Code that isobtained by the converter RunLevEnc, i.e., assigns a code word (bitstring) to the code number to generate a coded stream Str0.

FIG. 42 shows an example of a code table that is employed by therun-length encoding unit RLE0 c. The code table (first coding table) T1shown in FIG. 42 shows a code table corresponding to DC components of acolor-difference signal that is compliant with a draft H.26L standard(TML8) that is now being planned.

This code table T is composed of a regularly generable part includingcode numbers corresponding to pairs of level values and run values whichcan be calculated according to an arithmetic operation using levelvalues and run values (regularly build VLC), and an irregular partincluding code numbers corresponding to pairs of level values and runvalues which cannot be calculated by the arithmetic operation (tablelook up VLC). Further, a bit string (not shown) is assigned to each codenumber Code as a code word in a one-to-one relationship. A shorter codeword is assigned to a code number Code having a smaller value.

Next, a conventional decoding apparatus corresponding to the imagecoding apparatus 201 c will be described.

FIG. 40 is a block diagram illustrating an image decoding apparatus 202c that employs a conventional run-length decoding unit RLD0.

This image decoding apparatus 202 c decodes the coded stream Str0 c thatis outputted from the conventional image coding apparatus 201 c shown inFIG. 39.

The image decoding apparatus 202 c decodes quantized coefficients usingthe run value and the level value, as the image decoding apparatus 202 bin FIG. 36, while this image decoding apparatus 202 c does not carry outvariable length decoding of the run value and the level value separatelylike the image decoding apparatus 202 b, but carries out variable lengthdecoding of a pair comprising the run value and the level value(run-level pair).

To be more specific, the image decoding apparatus 202 c has a run-lengthdecoding unit RLD0 c that subjects the coded stream Str0 c outputtedfrom the image coding apparatus 201 c to a run-length decoding processusing a run-level pair comprising a run value and a level value. Theimage decoding apparatus 202 c further has, as the image decodingapparatus 202 b, an inverse quantization unit IQ for subjecting outputs(decoded quantized components) DQS from the run-length decoding unitRLDc to an inverse quantization process; a inverse frequencytransformation unit ITrans for subjecting outputs (decoded frequencycomponents) ITransS from the inverse quantization unit IQ to an inversefrequency transformation process; and a deblocking unit DeBlk forgenerating a decoded image signal Vout corresponding to each picture onthe basis of outputs (decoded pixel value components) DBlkS from theinverse frequency transformation unit ITrans.

Next, its operation will be described.

In the image decoding apparatus 202 c, the run-length decoding unit RLD0c carries out the inverse of the operation of the run-length encodingunit RLE0 c. To be more specific, the run-length decoding unit RLD0 csubjects the coded stream Str0 c to a run-length decoding process tooutput decoded quantized components DQS. The inverse quantization unitIQ carries out the inverse operation to the quantization unit Q, i.e.,an operation of inversely quantizing the decoded quantized componentsDQS with referring to a quantization parameter QP to output decodedfrequency components ITransS. The inverse frequency transformation unitITrans carries out the inverse operation to the frequency transformationunit Trans, i.e., an operation of subjecting the decoded frequencycomponents ITransS to inverse DCT or inverse Wavelet transformation, toreconstitute a decoded pixel value signal (decoded blocked image signal)DBlkS corresponding to each block. The deblocking unit DeBlk integratesthe image pixel value components for the respective blocks, and outputsa decoded image signal Vout corresponding to each picture (frame) Next,the run-length decoding unit RLD0 c will be specifically described.

FIG. 41 is a block diagram for explaining a specific construction of therun-length decoding unit RLD0 c.

This run-length decoding unit RLD0 c has a variable length decoder VLDfor subjecting the coded stream Str0 c to a variable length decodingprocess to obtain a code number Code corresponding to each code (codeword) included in the coded stream Str0 c; a run-level detectorRunLevDec for detecting a pair of a level value Lev and a run value Run,corresponding to the code number Code; and an inverse zigzag scannerIScan for reconstituting decoded quantized components DQS in atwo-dimensional array from decoded quantized components in aone-dimensional array, which are represented by the level values Lev andthe run values Run, on the basis of the pairs of the level values Levand the run values Run.

Next, its operation will be described.

In this run-length decoding unit RLD0 c, the variable length decoder VLDdecodes the coded stream Str0 c, and outputs a code number Codecorresponding to a code word (bit string) according to the inverseoperation to the variable length coder VLC. The run-level detectorRunLevDec refers to a code table or performs an arithmetic operation tooutput a pair of a level value Lev and a run value Run, corresponding tothe code number Code, according to the inverse operation to therun-level encoder RunLevEnc. The inverse zigzag scanner IScanreconstitutes decoded quantized components DQS in a two-dimensionalarray from quantized components in a one-dimensional array which arerepresented by the pairs of the level values Lev and the run values Runaccording to the inverse operation to the zigzag scanner Scan, andoutputs the decoded quantized components DQS to the inverse quantizationunit IQ.

Japanese Published Patent Application No. Hei. 6-237184 discloses arun-length encoding method in which plural coefficients in apredetermined order are coded using a run value Run that indicates thenumber of quantized components whose values are zero (zero coefficients)Coef, and a level value Lev that indicates a value of a quantizedcomponent whose value is not zero (non-zero coefficient) Coef, followingthe zero coefficients.

Japanese Patent No. 3144456 (corresponding to Japanese Published PatentApplication No. Hei. 8-79088) discloses a method by which a variablelength coding table (VLC table) is changed according to the value of adifferential motion vector value when the differential motion vectorvalue is coded using a variable length coding table in a method forpredictively coding digital video data.

Further, an arithmetical coding is known as another method by which thepixel values are variable-length coded, in which variable length codingis performed according to an arithmetic operation by using probabilityin which the pixel value may take a predetermined value. According tothe arithmetical coding, a code is derived from the probability, so thata probability table in which probabilities corresponding to individualsituations are described corresponds to the VLC table. Here, “All aboutMPEG-4” (first edition, first print, published Sep. 30, 1998, writtenand edited by Miki Sukeichi, pp. 69–73, Kogyo Chosakai Publishing Co.,Ltd.) describes a method by which pixel values of pixels correspondingto a coding target are subjected to arithmetic coding by changing aprobability table on the basis of a prediction method (context) for acoding target pixel which are predicted from pixel values of thesurrounding pixels.

The above-mentioned coding unit RLE0 a of the conventional image codingapparatus 201 a performs variable length coding for plural quantizedcoefficients which are obtained by quantizing frequency components ofimage data, for each predetermined processing unit (block). This codingunit employs a predetermined code table that indicates correspondencesbetween numerical value information showing the size of each quantizedcoefficient and a code (code word). In the variable length codingprocess by the coding unit, redundant information included in thequantized coefficient (data to be processed) cannot be removedsufficiently and, thus, the compression rate may be further improved.

Also in the run-length encoding unit that carries out variable lengthcoding of plural quantized coefficients using a run value that indicatesthe number of quantized components whose values are zero (zerocoefficients) Coef, and a level value that indicates a value of aquantized component whose value is not zero (non-zero coefficient) Coef,following the zero coefficients, like the coding units RLE0 b or RLE0 cin the conventional image coding apparatus 201 b or 201 c, redundantinformation included in the quantized coefficients in the variablelength coding process is not sufficiently removed.

Further, the decoding unit RLD0 a of the conventional image decodingapparatus 202 a or the run-length decoding unit RLD0 b or RLD0 c of theconventional image decoding apparatus 202 b or 202 c corresponds to acoding unit which cannot sufficiently remove redundant informationincluded in the quantized coefficients in the variable length codingprocess for the quantized coefficients.

Further, as for the method by which a variable length coding table (VLCtable) is changed according to the value of a differential motion vectorvalue when the differential motion vector value is coded using avariable length coding table in a method for predictively coding digitalvideo data, an effective change of the coding table in a variable lengthcoding process for data having such characteristics that plural zerocoefficients successively follow, like the quantized coefficients whichare obtained by quantizing frequency components of an image signal hasnot been known.

The present invention is made to solve the above-mentioned problems, andthis invention has for its object to provide a variable length codingmethod and a variable length decoding method, which can remove redundantinformation included in target data (quantized coefficients) for avariable length coding process, more effectively according tocharacteristics of the quantized coefficients and states of a codingprocess for the quantized components, thereby further increasing acompression rate of an image signal or the like.

SUMMARY OF THE INVENTION

According to the present invention, there is provided a variable lengthcoding method for coding coefficient data which is composed of pluralcoefficients including: a coding step for subjecting the respectivecoefficients to a coding process of transforming the coefficient datainto coded data which is composed of plural codes, by using plural codetables indicating correspondences between the values of the coefficientsand codes, and this coding step includes: a code table selection stepfor selecting the code table in accordance with at least one ofinformation about an coded coefficient which has been coded, and aparameter relating to encoding process of the coefficients; and a codeassignment step for assigning a code to a uncoded coefficient which hasnot yet been coded, using the selected code table. Therefore, redundantinformation included in coefficient data which are to be subjected tothe variable length coding process is effectively deleted by selectionof a code table according to characteristics of coefficients thatconstitute the coefficient data or states of a coding process for thecoefficients, thereby greatly increasing a coding efficiency of thevariable length coding process for image signals or the like.

According to the present invention, in the above-mentioned variablelength coding method, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and in the code table selectionstep, the code table that is used in the code assignment step isselected according to a value of the quantization step. Therefore, acode table that is adapted to the value of the quantization step andmaximizes the coding efficiency can be always employed.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run value that indicates a number of successive zerocoefficients whose values are zero, and a level value that indicates avalue of a non-zero coefficient following the zero coefficients are eachtransformed into a code, in the code table selection step, at least oneof a first selection process for selecting a code table from plural codetables that indicate correspondences between the run value and the codeaccording to the value of the quantization step, and a second selectionprocess for selecting a code table from plural code tables that indicatecorrespondences between the level value and the code according to thevalue of the quantization step is carried out, and in the codeassignment step, a code is assigned to at least one of a run value and alevel value corresponding to an uncoded coefficient which has not beencoded yet, on the basis of the selected code table. Therefore, theassignment of codes to at least one of run values and level values canbe performed always by using a code table that is adapted to the valueof the quantization step and minimizes the total number of bitscorresponding to the assigned codes.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run-level pair comprising a run value that indicates anumber of successive zero coefficients whose values are zero and a levelvalue that indicates a value of a non-zero coefficient following thezero coefficients is transformed into a code, in the code tableselection step, a code table is selected from plural code tables thatindicate correspondences between the run-level pair and the codeaccording to the value of the quantization step, and in the codeassignment step, a code is assigned to a run-level pair corresponding toan uncoded coefficient which has not yet been coded, on the basis of theselected code table. Therefore, the assignment of codes to run-levelpairs can be performed always by using a code table that is adapted tothe value of the quantization step and minimizes the total number ofbits corresponding to the assigned codes.

According to the present invention, in the above-mentioned variablelength coding method, in the code table selection step, the code tablethat is used in the code assignment step is selected in accordance withthe information about the already-processed coefficient which has beencoded. Therefore, the coding process for quantized coefficients can becarried out always by using a code table that is adapted to the numberof uncoded coefficients and maximizes the coding efficiency.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run value that indicates a number of successive zerocoefficients whose values are zero, and a level value that indicates avalue of a non-zero coefficient following the zero coefficients aretransformed into a code respectively, in the code table selection step,at least one of a first selection process for selecting a code tablefrom plural code tables that indicate correspondences between the runvalue and the code in accordance with information about a run valuecorresponding to the coded, and a second selection process for selectinga code table from plural code tables that indicate correspondencesbetween the level value and the code in accordance with informationabout a level value corresponding to the coded coefficients is carriedout, and in the code assignment step, a code is assigned to at least oneof a run value and a level value corresponding to an uncodedcoefficient, on the basis of the selected code table. Therefore, theassignment of codes to at least one of run values and level values canbe performed always by using a code table that is adapted to the numberof uncoded coefficients and maximizes the coding efficiency.

According to the present invention, in the above-mentioned variablelength coding method, in the code table selection step, a code table isselected from plural code tables that indicate correspondences betweenthe run value and the code according to a number of coded run valueswhich have been coded, and in the code assignment step, a code isassigned to an uncoded run value which has not been coded yet, on thebasis of the selected code table. Therefore, the assignment of codes torun values can be performed always by using a code table that is adaptedto the number of not-yet-processed run values and maximizes the codingefficiency.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run-level pair comprising a run value that indicates anumber of successive zero coefficients whose values are zero, and alevel value that indicates a value of a non-zero coefficient followingthe zero coefficients is transformed into a code, in the code tableselection step, a code table is selected from plural code tables thatindicate correspondences between the run-level pair and the code inaccordance with information about a run-level pair corresponding to acoded coefficient which has been coded, and in the code assignment step,a code is assigned to a run-level pair corresponding to an uncodedcoefficient which has not yet been coded, on the basis of the selectedcode table. Therefore, the assignment of codes to run-level pairs can beperformed always by using a code table that is adapted to the number ofnot-yet-processed coefficients and maximizes the coding efficiency.

According to the present invention, in the above-mentioned variablelength coding method, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and in the coding step, the codingprocess for the coefficients is carried out such that codes are assignedto plural coefficients that constitute the coefficient data from highfrequency component of corresponding image data to low frequencycomponent. Therefore, the total number of bits corresponding to codeswhich are assigned to the coefficients can be further reduced.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run-level pair comprising a run value that indicates anumber of successive zero coefficients whose values are zero and a levelvalue that indicates a value of a non-zero coefficient following thezero coefficients is transformed into a code, for each block that iscomposed of a predetermined number of coefficients, and in the codetable selection step, a code table is selected from plural code tablesthat indicate correspondences between the run-level pair and the codeaccording to a sum of a number of already-processed coefficients whichhave been subjected to the coding process in a target block that is anobject of the coding process, and a number of uncoded non-zerocoefficients which have not yet been coded in the target block, and inthe code assignment step, a code is assigned to a run-level paircorresponding to an uncoded coefficient in the target block, on thebasis of the selected code table. Therefore, a code table that does notinclude pairs of run values and level values which will never occur canbe employed, thereby increasing the variable length coding efficiency.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, a run-level pair comprising a run value that indicates anumber of successive zero coefficients whose values are zero and a levelvalue that indicates a non-zero coefficient following the zerocoefficients is transformed into a code, the coding step includes a codetable processing step for regularly changing the correspondences betweenthe run-level pair and the code in a first code table that indicatescorrespondence between the run-level pair and the corresponding codeaccording to combinations of the run value and the level value whichcompose the run-level pair, on the basis of the first code table,thereby to form a second code table having different correspondencesbetween the run-level pair and the code from the first code table, andin the code table selection step, one of the first and second codetables is selected in accordance with at least one of the informationabout the already-processed coefficient and the parameter relating tothe generation of the coefficients. Therefore, one of the first andsecond code tables is adaptively selected as an optimum code table thatis to be used when codes are assigned to pairs of run values and levelvalues, whereby redundant information included in the target data to beprocessed can be effectively deleted. Accordingly, the compression ratefor image signals or the like can be further improved, so that thisvariable length coding method is highly useful.

According to the present invention, in the above-mentioned variablelength coding method, in the first and second code tables, shorter codesare made correspond adaptively to respective run-level pairs havingsmaller level values that compose the run-level pairs, and in the secondcode table, level values of run-level pairs to which shorter codes aremade correspond are small on average as compared to the first codetable. Therefore, this variable length coding method is useful when thequantization parameter for coefficients that constitute the target datato be processed is large.

According to the present invention, in the above-mentioned variablelength coding method, in the first and second code tables, shorter codesare made correspond adaptively to respective run-level pairs havingsmaller run values that compose the run-level pairs, and in the secondcode table, run values of run-level pairs to which shorter codes aremade correspond are small on average as compared to the first codetable. Therefore, this variable length coding method is useful when thequantization parameter for the coefficients that constitute the targetdata to be processed is small.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, the transformation of run-level pairs into codes iscarried out for each block that is composed of a predetermined number ofcoefficients, and in the code table processing step, the second codetable is formed according to a number of already-processed coefficientswhich have been subjected to the coding process in a target block thatis an object of the coding process. Therefore, a code table that doesnot include pairs comprising run values and level values which willnever occur can be employed as the second code table, thereby furtherincreasing the variable length coding efficiency.

According to the present invention, in the above-mentioned variablelength coding method, in the code assignment step, the assignment ofcodes to run-level pairs is carried out from a run-level paircorresponding to a coefficient having a highest frequency component ofimage data, from high frequency component to low frequency component.Therefore, the increase in the variable length coding efficiency,obtained by using the code table that does not include pairs comprisingrun values and level values which will never occur as the second codetable, can be made larger.

According to the present invention, in the above-mentioned variablelength coding method, the second code table is formed by changing onlycorrespondences which can be regularly operated, among thecorrespondences between the run-level pair and the code included in thefirst code table. Therefore, an arithmetic operation that is requiredfor the formation of the second code table can be reduced.

According to the present invention, in the above-mentioned variablelength coding method, the coefficients constituting the coefficient dataare obtained by quantizing frequency components of image data, inaccordance with a quantization step corresponding to the image data, andthe code table selection step is a code table switching step forswitching between the first code table and the second code tableaccording to a value of the quantization step. Therefore, a code tablethat is adapted to the quantization step can be employed as the codetable to be used in a variable length coding process for thecoefficients that constitute the target data to be processed.

According to the present invention, in the above-mentioned variablelength coding method, the code table selection step is a code tableswitching step for switching between the first code table and the secondcode table in accordance with a switch instruction signal, and in thecoding step, coding of the switch instruction signal is carried out.Therefore, the code table to be used in the variable length codingprocess for the coefficients can be changed according to characteristicsof the target data or the like.

According to the present invention, in the above-mentioned variablelength coding method, according to the coding process for thecoefficients, the transformation of run-level pairs into codes iscarried out for each block that is composed of a predetermined number ofcoefficients, and in the code table processing step, the second codetable is formed on the basis of a sum of a number of already-processedcoefficients which have been subjected to the coding process in a targetblock that is an object of the coding process, and a number of uncodednon-zero coefficients which have not been coded yet in the target block.Therefore, a code table that does not include pairs of run values andlevel values which will never occur can be used as the second codetable, thereby further increasing the variable length coding efficiency.

According to the present invention, there is provided a variable lengthcoding apparatus that encodes coefficient data that is composed ofplural coefficients including: a coding unit for subjecting therespective coefficients to a coding process of transforming thecoefficient data into coded data which is composed of plural codes, byusing plural code tables indicating correspondences between the valuesof the coefficients and codes, and this coding unit includes: a codetable selection unit for selecting the code table in accordance with atleast one of information about a coded coefficient which has been coded,and a parameter relating to encoding process of the coefficients; and acode assignment unit for assigning a code to an uncoded coefficientwhich has not yet been coded, using the selected code table. Therefore,redundant information included in coefficient data which are to besubjected to the variable length coding process is effectively deletedby selection of a code table according to characteristics ofcoefficients that constitute the coefficient data or states of thecoding process for the coefficients, thereby greatly increasing thecoding efficiency in the variable length coding process for imagesignals or the like.

According to the present invention, in the above-mentioned variablelength coding apparatus, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and the code table selection unitselects the code table that is to be used by the code assignment unit,according to a value of the quantization step. Therefore, a code tablethat is adapted to the value of the quantization step and maximizes thecoding efficiency can be always used.

According to the present invention, in the above-mentioned variablelength coding apparatus, the code table selection unit selects the codetable that is to be used by the code assignment unit, in accordance withthe information about the coded coefficient. Therefore, the codingprocess for quantized coefficients can be carried out always by using acode table is adapted to the number of not-yet-processed coefficientsand maximizes the coding efficiency.

According to the present invention, in the above-mentioned variablelength coding apparatus, according to the coding process for thecoefficients, a run value that indicates a number of successive zerocoefficients whose values are zero, and a level value that indicates avalue of a non-zero coefficient following the zero coefficients are eachtransformed into a code, the code table selection unit selects a codetable from plural code tables that indicate correspondences between therun value and the code, according to a number of coded run values towhich codes have been assigned, and the code assignment unit assigns acode to an uncoded run value which has not been coded yet, on the basisof the selected code table. Therefore, the assignment of codes to runvalues can be performed always by using a code table that is adapted tothe number of not-yet-processed run values and maximizes the codingefficiency.

According to the present invention, in the above-mentioned variablelength coding apparatus, the coefficients are obtained by quantizingfrequency components of image data, in accordance with a quantizationstep corresponding to the image data, and the coding unit carries outthe coding process for the coefficients such that codes are assigned tothe plural coefficients that constitutes the coefficient data from highfrequency component to low frequency component. Therefore, the totalnumber of bits corresponding to codes that are assigned to thecoefficients can be further reduced.

According to the present invention, there is provided a storage mediumthat contains a program for executing a variable length coding processfor coding coefficient data that is composed of plural coefficients, bya computer, and this program includes: a coding step for subjecting therespective coefficients to a coding process of transforming thecoefficient data into coded data which is composed of plural codes, byusing plural code tables indicating correspondences between the valuesof the coefficients and codes, and further this coding step includes: acode table selection step for selecting the code table in accordancewith at least one of information about a coded coefficient which hasbeen coded, and a parameter relating to encoding process of thecoefficients; and a code assignment step for assigning a code to anuncoded coefficient which has not yet been coded, using the selectedcode table. Therefore, a variable length coding process having a highercoding efficiency, which can effectively delete redundant informationincluded in coefficient data as an object to be subjected to thevariable length coding process by selection of a code table according tocharacteristics of coefficients constituting the coefficient data orstates of the coding process for the coefficients, can be implemented bysoftware.

According to the present invention, there is provided a variable lengthdecoding method for decoding coded data that is composed of pluralcodes, obtained by performing variable length coding to coefficient datathat is composed of plural coefficients, including: a decoding step forsubjecting the respective codes to a decoding process of decoding thecoded data to reconstitute the coefficient data which is composed of theplural coefficients, using plural code tables indicating correspondencesbetween the values of the coefficients and the codes, and this decodingstep includes: a code table selection step for selecting the code tablein accordance with at least one of information about a decodedcoefficient which has been decoded and a parameter relating to decodingprocess; and a value detection step for detecting the valuecorresponding to an undecoded code which has not yet been decoded, byusing the selected code table. Therefore, a variable length decodingprocess corresponding to a variable length coding process having ahigher coding efficiency, which can effectively delete redundantinformation included in coefficient data by changing a code table, toencode the coefficient data can be carried out.

According to the present invention, in the above-mentioned variablelength decoding process, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and in the code table selectionstep, the code table that is used in the value detection step isselected according to a value of the quantization step. Therefore, avariable length decoding process corresponding to a variable lengthcoding process that always employs a code table which is adapted to thevalue of the quantization step and maximizes the coding efficiency canbe carried out.

According to the present invention, in the above-mentioned variablelength decoding process, in the decoding process for the codes, a codeis decoded to reconstitute to a run value that indicates a number ofsuccessive zero coefficients whose values are zero, and a level valuethat indicates a value of a non-zero coefficient following the zerocoefficients, in the code table selection step, at least one of a firstselection process for selecting a code table from plural code table thatindicate correspondences between the run value and the code, accordingto the value of the quantization step, and a second selection processfor selecting a code table from plural code tables that indicatecorrespondences between the level value and the code according to thevalue of the quantization step is carried out, and in the numericalvalue detection step, at least one of a run value and a level valuecorresponding to an undecoded which has not yet been decoded isdetected, on the basis of the selected code table. Therefore, a variablelength decoding process corresponding to a variable length codingprocess that performs the assignment of codes to at least one of runvalues and level values always by using a code table that is adapted tothe value of the quantization step and minimizes the total number ofbits corresponding to the assigned codes can be carried out.

According to the present invention, in the above-mentioned variablelength decoding process, according to the decoding process for codes, acode is decoded to reconstitute a run-level pair comprising a run valuethat indicates a number of successive zero coefficients whose values arezero, and a level value that indicates a value of a non-zero coefficientfollowing the zero coefficients, in the code table selection step, acode table is selected from plural code tables that indicatecorrespondences between the run-level pair and the code according to thevalue of the quantization step, and in the numerical value detectionstep, a run-level pair corresponding to an undecoded code which hasundecoded is detected on the basis of the selected code table.Therefore, a variable length decoding process corresponding to avariable length coding process that performs the assignment of codes torun-level pairs always by using a code table that is adapted to thevalue of the quantization step and minimizes the total number of bitscorresponding to the assigned codes can be carried out.

According to the present invention, in the above-mentioned variablelength decoding process, in the code table selection step, the codetable that is used in the numerical value detection step is selected inaccordance with information about a decoded coefficient. Therefore, avariable length decoding process corresponding to a variable lengthcoding process that encodes quantized coefficients always by using acode table that is adapted to the number of not-yet-processedcoefficients and maximizes the coding efficiency can be carried out.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for the codes,the code is decoded to reconstitute a run value that indicates a numberof successive zero coefficients whose values are zero, and a level valuethat indicates a value of a non-zero coefficient following the zerocoefficients, respectively, in the code table selection step, at leastone of a first selection process for selecting a code table from pluralcode tables that indicate correspondences between the run value and thecode in accordance with information about an decoded run value, and asecond selection process for selecting a code table from plural codetables that indicate correspondences between the level value and thecode in accordance with information about an decoded level value iscarried out, and in the value detection step, at least one of a runvalue and a level value corresponding to an undecoded code is detectedon the basis of the selected code table. Therefore, a variable lengthdecoding process corresponding to a variable length coding process thatperforms the assignment of codes to at least one of run values and levelvalues always by using a code table that is adapted to the number ofnot-yet-processed coefficients and maximizes the coding efficiency canbe carried out.

According to the present invention, in the above-mentioned variablelength decoding method, in the code table selection step, a code tableis selected from plural code tables that indicate correspondencesbetween the run value and the code according to a number of decoded runvalues which have been already decoded, and in the value detection step,a run value corresponding to an undecoded code which has not yet beendecoded is detected on the basis of the selected code table. Therefore,a variable length decoding process corresponding to a variable lengthcoding process that performs the assignment of codes to run valuesalways by using a code table that is adapted to the number ofnot-yet-processed run values and maximizes the coding efficiency can becarried out.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for codes, acode is decoded to reconstitute a run-level pair comprising a run valuethat indicates a number of successive zero coefficients whose values arezero, and a level value that indicates a number of non-zero coefficientfollowing the zero coefficients, in the code table selection step, acode table is selected from plural code tables that indicatecorrespondences between the run-level pair and the code in accordancewith information about a run-level pair that has been obtained by thedecoding process, and in the numerical value detection step, a run-levelpair corresponding to an undecoded code which has not been decoded yetis detected on the basis of the selected code table. Therefore, avariable length decoding process corresponding to a variable lengthcoding process that performs the assignment of codes to run-level pairsalways by using a code table that is adapted to the number ofnot-yet-processed coefficients and maximizes the coding efficiency canbe carried out.

According to the present invention, in the above-mentioned variablelength decoding method, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and in the decoding step, thedecoding process for codes is carried out such that values correspondingto the codes are obtained from high frequency component to low frequencycomponent. Therefore, a variable length decoding process correspondingto a variable length coding process that can further reduce the totalnumber of bits corresponding to codes which are assigned to thecoefficients can be carried out.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for the codes,a code is decoded to reconstitute a run-level pair comprising a runvalue that indicates a number of successive zero coefficients whosevalues are zero, and a level value that indicates a value of a non-zerocoefficient following the zero coefficients, for each block that iscomposed of a predetermined coefficients comprising the coefficientdata, in the code table selection step, a code table is selected fromplural code tables that indicate correspondences between the run-levelpair and the code according to a sum of a number of already-processedcoefficients in a target block that is an object of the decodingprocess, which have been obtained by the decoding process for the targetblock, and a number of undecoded non-zero coefficient in the targetblock, which have not yet been obtained by the decoding process for thetarget block, and in the numerical value detection step, a run-levelpair corresponding to an undecoded coefficient in the target block isdetected on the basis of the selected code table. Therefore, a variablelength decoding process corresponding to a variable length codingprocess that has a higher efficiency can be implemented by using a codetable which does not include pairs comprising run values and levelvalues which will never occur.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for the codes,a code that constitutes the coded data is decoded to reconstitute arun-level pair comprising a run value that indicates a number ofsuccessive zero coefficients whose values are zero, and a level valuethat indicates a value of a non-zero coefficient following the zerocoefficients, the decoding step includes a code table processing stepfor regularly changing correspondences between the run-level pair andthe code in a first code table that indicates correspondence between therun-level pair and the corresponding code according to combinations of arun value and a level value which compose the run-level pair, on thebasis of the first code table, thereby to form a second code tablehaving different correspondences between the run-level pair and the codefrom the first code table, and in the code table selection step, one ofthe first and second code tables is selected in accordance with at leastone of the information about the already-processed coefficient and theparameter relating to the generation of the coefficients Therefore, oneof the first and second code tables is adaptively selected as an optimumcode table that is to be used when codes are transformed into pairs ofrun values and level values. Accordingly, a variable length decodingprocess corresponding to a variable length coding process thateffectively delete redundant information included in target data to beprocessed is satisfactorily carried out, so that this variable lengthdecoding method is highly useful.

According to the present invention, in the above-mentioned variablelength decoding method, in the first and second code tables, shortercodes are made adaptively correspond to respective run-level pairshaving smaller level values that compose the run-level pairs, and in thesecond code table, level values of run-level pairs to which shortercodes are made correspond are small on average as compared to the firstcode table. Therefore, this variable length decoding method is effectivein cases where a quantization parameter relating to coefficients thatconstitute the target data to be processed is large.

According to the present invention, in the above-mentioned variablelength decoding method, in the first and second code tables, shortercodes are made adaptively correspond to respective run-level pairshaving smaller run values that compose the run-level pairs, and in thesecond code table, run values of run-level pairs to which shorter codesare made correspond are small on average as compared to the first codetable. Therefore, this variable length decoding method is effective incases where the quantization parameter relating to coefficients thatconstitute the target data to be processed is small.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for the codes,the reconstitution of a run-level pair from a code is performed for eachblock that is composed of a predetermined number of coefficients whichcompose the coefficient data, and in the code table processing step, thesecond code table is formed according to a number of already-processedcoefficients which have been obtained by the decoding process in atarget block that is an object of the decoding process. Therefore, acode table that does not include pairs of run values and level valueswhich will never occur can be employed as the second code table, wherebya variable length decoding process corresponding to a variable lengthcoding process that has a higher efficiency can be implemented.

According to the present invention, in the above-mentioned variablelength decoding method, in the numerical value detection step, thedetection of a run-level pair corresponding to the code is performedfrom a run-level pair having a highest frequency component of imagedata, from high frequency component to low frequency component.Therefore, a code table that does not include pairs of run values andlevel values which will never occur can be employed as the second codetable, whereby a variable length decoding process corresponding to avariable length coding process that increases the compression rate moreeffectively can be implemented.

According to the present invention, in the above-mentioned variablelength decoding method, the second code table is formed by changing onlycorrespondences which can be regularly operated, among correspondencesbetween the run-level pair and the code included in the first codetable. Therefore, an arithmetic operation that is required for formationof the second code table can be reduced.

According to the present invention, in the above-mentioned variablelength decoding method, the coefficients constituting the coefficientdata are obtained by quantizing frequency components of image data, inaccordance with a quantization step corresponding to the image data, andin the code table selection step, switching between the first code tableand the second code table is performed according to a value of thequantization step. Therefore, a code table that is suitable for thequantization step can be employed as the code table which is to be usedin the variable length decoding process for coefficients constitutingthe target data to be processed.

According to the present invention, in the above-mentioned variablelength decoding method, the code table selection step includes a codetable switching step for switching between the first code table and thesecond code table in accordance with a switch instruction signal, and inthe decoding step, decoding of the switch instruction signal is carriedout. Therefore, a code table to be employed in the variable lengthdecoding process can be switched according to characteristics of targetdata to be processed or the like.

According to the present invention, in the above-mentioned variablelength decoding method, according to the decoding process for the codes,the reconstitution of a run-level pair from a code is performed for eachblock that is composed of a predetermined number of coefficients whichcompose the coefficient data, and in the code table processing step, thesecond code table is formed according to a sum of a number ofalready-processed coefficients in a target block that is an object ofthe decoding process, which have been obtained by the decoding processfor the target block, and a number of undecoded non-zero coefficients inthe target block, which have not yet been obtained by the decodingprocess for the block. Therefore, a code table that does not includepairs of run values and level values which will never occur is employedas the second code table, whereby a variable length decoding processcorresponding to a variable length coding process having a much higherefficiency can be implemented.

According to the present invention, there is provided a variable lengthdecoding apparatus that decodes coded data that is composed of pluralcodes, obtained by performing variable length coding to coefficient datathat is composed of plural coefficients, including: a decoding unit forsubjecting the respective codes to a decoding process for decoding thecoded data to reconstitute the coefficient data that is composed of theplural coefficients, using plural code tables indicating correspondencesbetween the values of the coefficients and codes, and this decoding unitincludes: a code table selection unit for selecting a code table fromplural code tables in accordance with at least one of information abouta decoded coefficient which has been decoded and a parameter relating todecoding process of the coefficients; and a value detection unit fordetecting the value corresponding to an undecoded code which has not yetbeen decoded, by using the selected code table. Therefore, a variablelength decoding process corresponding to a variable length codingprocess having a higher coding efficiency, which effectively deletesredundant information in coefficient data by changing a code table, toencode the coefficient data can be carried out.

According to the present invention, in the above-mentioned variablelength decoding apparatus, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and the code table selection unitselects the code table that is used by the numerical value detectionunit, according to a value of the quantization step. Therefore, avariable length decoding process corresponding to a variable lengthcoding process that always employs a code table which is adapted to thevalue of the quantization step and maximizes the coding efficiency canbe carried out.

According to the present invention, in the above-mentioned variablelength decoding apparatus, the code table selection unit selects thecode table that is used by the numerical value detection unit, inaccordance with information about a decoded coefficient. Therefore, avariable length decoding process corresponding to a variable lengthcoding process which encodes quantized coefficients always by using acode table that is adapted to the number of undecoded coefficients andmaximizes a coding efficiency can be carried out.

According to the present invention, in the above-mentioned variablelength decoding apparatus, according to the decoding process for thecodes, the code is decoded to reconstitute a run value that indicates anumber of successive zero coefficients whose values are zero, and alevel value that indicates a value of a non-zero coefficient followingthe zero coefficients, respectively, the code table selection unitselects a code table from plural code tables that indicatecorrespondences between the run value and the code, according to anumber of decoded run values, and the value detection unit detects a runvalue corresponding to a decoded code, on the basis of the selected codetable. Therefore, a variable length decoding process corresponding to avariable length coding process which performs the assignment of codes torun values always by using a code table that is adapted to the number ofnot-yet-processed run values and maximizes the coding efficiency can becarried out.

According to the present invention, in the above-mentioned variablelength decoding apparatus, the coefficients are obtained by quantizingfrequency components of image data in accordance with a quantizationstep corresponding to the image data, and the decoding unit carries outthe decoding process for the codes such that the value corresponding tothe codes is obtained from high frequency component to low frequencycomponent. Therefore, a variable length decoding process correspondingto a variable length coding process that can further reduce the totalnumber of bits corresponding to codes assigned to the coefficients canbe carried out.

According to the present invention, there is provided a storage mediumthat contains a program for executing a variable length decoding processfor decoding coded data that is composed of plural codes, obtained byperforming variable length coding to coefficient data that is composedof plural coefficients, by a computer, and this program includes adecoding step for subjecting the respective codes to a decoding processof decoding the coded data to reconstitute the coefficient data which iscomposed of the plural coefficients, using plural code tables indicatingcorrespondences between the value of the coefficients and codes, andfurther this decoding step includes: a code table selection step forselecting the code table in accordance with at least one of informationabout a decoded coefficient which has been decoded and a parameterrelating to decoding process of the coefficients; and a value detectionstep for detecting the value corresponding to an undecoded code whichhas not yet been decoded, by using the selected code table. Therefore, avariable length decoding process corresponding to a variable lengthcoding process having a higher coding efficiency, which can effectivelydelete redundant information included in coefficient data by changing acode table, to encode the coefficient data can be implemented bysoftware.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram for explaining an image coding apparatus 101according to a first embodiment of the present invention.

FIG. 2 is a block diagram illustrating a run-length encoding unit RLE1that constitutes the image coding apparatus 101 according to the firstembodiment.

FIGS. 3( a)–3(d) are diagrams for explaining zigzag scanning by therun-length encoding unit RLE1, and FIGS. 3( e) and 3(f) are diagrams forexplaining reordering of run values and level values.

FIGS. 4( a) and 4(b) are diagrams for explaining processing in avariable length coder LVLC of the run-length encoding unit RLE1: FIG. 4(a) is a flowchart showing a variable length coding process for a levelvalue, and FIG. 4( b) is a code table that is used in the variablelength coding process for the level value.

FIGS. 5( a) and 5(b) are diagrams for explaining processing in avariable length coder RVLC of the run-length encoding unit RLE1: FIG. 5(a) is a flowchart showing a variable length coding process for a runvalue, and FIG. 5( b) is a code table that is used in the variablelength coding process for the run value.

FIGS. 6( a) and 6(b) are diagrams showing the total number of bitscorresponding to codes which are assigned to level values (aquantization parameter is relatively small) by the variable length coderLevVLC in a case where a code table L2 is employed (FIG. 6( a)), and ina case where a code table L1 is employed (FIG. 6( b)), respectively.

FIGS. 7( a) and 7(b) are diagrams showing the total number of bitscorresponding to codes which are assigned to level values (aquantization parameter is relatively large) by the variable length coderLevVLC in a case where the code table L2 is employed (FIG. 7( a)), andin a case where the code table L1 is employed (FIG. 7( b)),respectively.

FIGS. 8( a)–8(c) are diagrams showing the total number of bitscorresponding to codes which are assigned to run values by the variablelength coder RVLC in a case where a specific code table is employed(FIG. 8 (a)), a case where change of a code table and reordering of runvalues are performed (FIG. 8( b)), and a case where only change of acode table is performed (FIG. 8( c)), respectively.

FIG. 9 is a block diagram for explaining an image decoding apparatus 102according to a second embodiment of the present invention.

FIG. 10 is a block diagram illustrating a run-length decoding unit RLD1that constitutes the image decoding apparatus 102 according to thesecond embodiment.

FIGS. 11( a) and 11(b) are diagrams for explaining a variable lengthdecoding process by a variable length decoder LVLD: FIG. 11( a) is aflowchart showing a variable length decoding process for reconstitutinga level value, and FIG. 11( b) is a code table that is employed in thevariable length decoding process.

FIGS. 12( a) and 12(b) are diagrams for explaining a variable lengthdecoding process by a variable length decoder RVLD: FIG. 12( a) is aflowchart showing a variable length decoding process for reconstitutinga run value, and FIG. 12( b) is a code table that is employed in thevariable length decoding process.

FIG. 13 is a block diagram for explaining an image coding apparatus 103according to a third embodiment of the present invention.

FIG. 14 is a block diagram illustrating a run-length encoding unit RLE2that constitutes the image coding apparatus 103 according to the thirdembodiment.

FIGS. 15( a) and 15(b) are diagrams showing examples T2 a (FIG. 15( a))and T2 b (FIG. 15( b)) of a code table (second code table) that isformed by the run-length encoding unit RLE2 according to the thirdembodiment.

FIGS. 16( a)–16(c) are diagrams showing other examples T2 c (FIG. 16(a)), T2 d (FIG. 16( b)), T2 e (FIG. 16( c)) of the code table (secondcode table) that is formed by the run-length encoding unit RLE2according to the third embodiment.

FIG. 17 is a diagram showing an example of an order in which quantizedcomponents are coded by the run-length encoding unit RLE2 according tothe third embodiment.

FIG. 18 is a block diagram for explaining an image decoding apparatus104 according to a fourth embodiment of the present invention.

FIG. 19 is a block diagram illustrating a run-length decoding unit RLD2that constitutes the image decoding apparatus 104 according to thefourth embodiment.

FIG. 20 is a block diagram for explaining an image coding apparatus 105according to a fifth embodiment of the present invention.

FIG. 21 is a block diagram illustrating a run-length encoding unit RLE3that constitutes the image coding apparatus 105 according to the fifthembodiment.

FIG. 22 is a block diagram for explaining an image decoding apparatus106 according to a sixth embodiment of the present invention.

FIG. 23 is a block diagram illustrating a run-length decoding unit RLD3that constitutes the image decoding apparatus 106 according to the sixthembodiment.

FIGS. 24( a)–24(c) are diagrams showing examples Ta (FIG. 24( a)), Tb(FIG. 24( b)), and Tc (FIG. 24( c)) of a variable-length code table thatis employed by the run-length encoding unit RLE3 according to the fifthembodiment and the run-length decoding unit RLD3 according to the sixthembodiment.

FIGS. 25( a)–25(c) are diagrams for explaining a data storage mediumwhich contains a program for implementing a variable length codingprocess or a variable length decoding process according to any of theabove embodiments by a computer system (FIG. 25( a) and 25(b)), and thecomputer system (FIG. 25( c)).

FIG. 26 is a diagram for explaining an application of an image codingmethod and an image decoding method according to any of embodiments, andthis figure shows a contents supply system that implements contentsdistribution services.

FIG. 27 is a diagram for explaining a portable telephone that employs animage coding method and an image decoding method according to any ofembodiments.

FIG. 28 is a block diagram illustrating the portable telephone as shownin FIG. 27.

FIG. 29 is a diagram showing a digital broadcasting system that employsan image coding apparatus or an image decoding apparatus according toany of embodiments.

FIG. 30 is a block diagram illustrating a conventional image codingapparatus 201 a.

FIG. 31 is a block diagram for explaining a coding unit. RLE0 a thatconstitutes the conventional image coding apparatus 201 a.

FIG. 32 is a block diagram for explaining a conventional decodingapparatus 202 a corresponding to the conventional image coding apparatus201 a.

FIG. 33 is a block diagram for explaining a decoding unit RLD0 a thatconstitutes the conventional image decoding apparatus 202 a.

FIG. 34 is a block diagram illustrating an image coding apparatus 201 bthat performs conventional run-length encoding.

FIG. 35 is a block diagram for explaining a run-length encoding unitRLE0 b that constitutes the conventional image coding apparatus 201 b.

FIG. 36 is a block diagram for explaining a conventional image decodingapparatus 202 b corresponding to the conventional image coding apparatus201 b.

FIG. 37 is a block diagram for explaining a run-length decoding unitRLD0 b that constitutes the conventional image decoding apparatus 202 b.

FIG. 38 is a block diagram for explaining another image coding apparatus201 c that performs the conventional run-length encoding.

FIG. 39 is a block diagram illustrating a run-length encoding unit RLE0c that constitutes the conventional image coding apparatus 201 c.

FIG. 40 is a block diagram for explaining a conventional image decodingapparatus 202 c corresponding to the conventional image coding apparatus201 c.

FIG. 41 is a block diagram for explaining a run-length decoding unitRLD0 c that constitutes the conventional image decoding apparatus 202 c.

FIG. 42 is a diagram showing an example of a code table that is employedby the run-length encoding unit RLE0 c that constitutes the conventionalimage coding apparatus 201 c.

FIG. 43 is a diagram showing an example of an order in which quantizedcomponents are coded by the conventional run-length encoding units RLE0a, RLE0 b, or RLE0 c.

BEST MODE FOR CARRYING OUT THE INVENTION

Initially, fundamental principles of the present invention will bedescribed.

Generally, when the quantization step is rough, quantized componentshave smaller absolute values. Then, the run (the length of successivelycontinuing zero coefficients) gets longer, and accordingly the levelvalue (the value of a non-zero coefficient) has a smaller absolutevalue. On the contrary, when the quantization step is fine, thequantized components have larger absolute values. Therefore, the rungets shorter and accordingly the level value has a larger absolutevalue.

Further, when variable length coding of many quantized components hasbeen already completed in an object block to be processed and the numberof quantized components which are uncoded is small, a run value thatexceeds the number of uncoded quantized components never occurs. Thus,when pairs of these run values and level values are removed, the codingefficiency is increased.

From this point of view,the present invention changes a code tableindicating correspondences between numerical value information thatshows the size of a quantized coefficient and a code, according to astate of a variable length coding process or a variable length decodingprocess for quantized coefficients and a parameter associated withgeneration of quantized coefficients (quantization parameter), therebyeffectively removing redundant information included in target data(quantized coefficient) of the variable length coding process.

For example, the change of the code table is carried out by selectingeither a code table (first code table) that is employed in theconventional variable length coding or decoding process, or a secondcode table that is formed on the basis of the first code table andoptimized for the data to be processed, on the basis of a processingstate of quantized coefficients. It is unnecessary to form the secondcode table always on the basis of the first code table, but any codetable that is adapted for processing target data may be selected as acode table.

Hereinafter, embodiments of the present invention will be described withreference to FIGS. 1 to 25.

[Embodiment] 1

FIG. 1 is a block diagram for explaining an image coding apparatusaccording to a first embodiment of the present invention.

This image coding apparatus 101 according to the first embodiment has,in place of the run-length encoding unit RLE0 b in the conventionalimage coding apparatus 201 b shown in FIG. 34 which subjects an output(quantized components) QS from the quantization unit Q to a variablelength coding process and outputs a coded stream Str0 b, a run-lengthencoding unit RLE1 for subjecting the output QS from the quantizationunit Q to a variable length coding process on the basis of aquantization parameter QP and a VLC selection signal VlcSel, and outputsa coded stream Str1.

Here, the quantization parameter QP is a parameter that indicates avalue of a quantization step, and the quantization step is approximatelyproportional to the quantization parameter QP. To be more specific, whenthe quantization parameter QP is larger, quantized components havesmaller absolute values, then zero run of the quantized components (thelength of successively continuing components whose values are zero) getslonger, and a level value has a smaller absolute value.

FIG. 2 is a block diagram for explaining a specific construction of therun-length encoding unit RLE1.

This run-length encoding unit RLE1 has, like the conventional run-lengthencoding unit RLE0 b shown in FIG. 35, a zigzag scanner Scan fortransforming an output from the quantization unit Q (quantizedcomponents) QS in a two-dimensional array, into quantized coefficientsCoef in a one-dimensional array (i.e., a predetermined order); a runcalculator RunCal for calculating the number of successive quantizedcomponents whose values are zero (zero coefficients) Coef and outputtinga run value Run that indicates the number of successive zerocoefficients; and a level calculator LevCal for calculating a value of aquantized component whose value is not zero (non-zero coefficient) Coef,following the zero coefficients, and outputting a level value Lev thatindicates the value of the non-zero coefficient.

FIG. 3( a) shows a two-dimensional array of quantized components Q11 toQ16 corresponding to one block, and FIG. 3( b) shows a scanning courseof the quantized components Q1 to Q16 in the zigzag scanner Scan byarrows A1 to A15. Here, a quantized component Q1 is obtained byquantizing DC components of frequency components corresponding to animage signal, and quantized components Q2 to Q16 are obtained byquantizing AC components of the frequency components corresponding tothe image signal. FIG. 3( c) shows a one-dimensional array (codingorder) of the quantized components Q1 to Q16; which is obtained by thezigzag scanning in the zigzag scanner Scan, and FIG. 3( d) shows aone-dimensional array of concrete numerical values which indicate thevalues of the quantized components Q1 to Q16.

The run-length encoding unit RLE1 further includes a reordering unitLreodr for reordering level values Lev which are outputs from the levelcalculator LevCal; a reordering unit Rreodr for reordering run valuesRun which are outputs from the run calculator RunCal; and a numbercalculator NumClc for calculating the number Cnum of uncodedcoefficients in a target block on the basis of the outputs from the runcalculator RunCal and outputting the calculated number. FIG. 3( e) showsorders of run values and level values which are obtained from thenumerical values of the quantized components having the arrangements asshown in FIGS. 3( c) and 3(d). FIG. 3( f) shows orders of the run valuesand the level values after the reordering.

The run-length encoding unit RLE1 further includes a variable lengthcoder LVLC for subjecting an output ROLev from the reordering unitLreodr to a variable length coding process on the basis of thequantization parameter QP and a selection signal VlSel, and outputting acode string (level value code string) LStr; a variable length coder RVLCfor subjecting an output RORun from the reordering unit Rreodr to avariable length coding process on the basis of the number Cnum of theuncoded coefficients, and outputting a code string (run value codestring) RStr; and a multiplexer MUX for multiplexing the code stringLStr and the code string RStr for each block and outputting amultiplexed coded stream Str1.

FIGS. 4( a) and 4(b) are diagrams for explaining the variable lengthcoding process by the variable length coder LVLC. FIG. 4( a) is aflowchart explaining the variable length coding process for a levelvalue, and FIG. 4( b) is an explanatory diagram showing code tableswhich are employed in the variable length coding process for the levelvalue.

FIG. 4( b) shows an arrangement Alev of level values (Level), anarrangement Ca1 of codes (code words) in a case where the quantizationparameter QP is smaller than a threshold, and an arrangement Ca2 ofcodes (code words) in a case where the quantization parameter QP isequal to or larger than the threshold.

Here, a code table L1 is constituted by the arrangement Alev of thelevel values (Level) and the arrangement Ca1 of the codes (code words)in the case where the quantization parameter QP is smaller than thethreshold. This code table L1 shows correspondence between the levelvalue (Level) and the code in the case where the quantization parameterQP is smaller than the threshold. A code table L2 is constituted by thearrangement Alev of the level values (Level) and the arrangement Ca2 ofthe codes (code words) in the case where the quantization parameter QPis equal to or larger than the threshold. This code table L2 showscorrespondence between the level value (Level) and the code in the casewhere the quantization parameter QP is equal to or larger than thethreshold.

FIGS. 5( a) and (b) are diagrams for explaining the variable lengthcoding process by the variable length coder RVLC. FIG. 5( a) is aflowchart for explaining a variable length coding process for a runvalue, and FIG. 5( b) is an explanatory diagram showing code tableswhich are employed in the variable length coding process for the runvalue.

FIG. 5( b) shows an arrangement A run of run values (Run) an arrangementCb1 of codes (code words) in a case where the number of uncoded zerocoefficient is one, an arrangement Cb2 of codes (code words) in a casewhere the number of uncoded zero coefficients is two, an arrangement Cb3of codes (code words) in a case where the number of uncoded zerocoefficients is three, an arrangement Cb4 of codes (code words) in acase where the number of uncoded zero coefficients is four, anarrangement Cb5 of codes (code words) in a case where the number ofuncoded zero coefficients is five, an arrangement Cb6 of codes (codewords) in a case where the number of uncoded zero coefficients is six,an arrangement Cb7 of codes (codewords) in a case where the number ofuncoded zero coefficients is seven, and an arrangement Cb8 of codes(code words) in a case where the number of uncoded zero coefficients iseight or more.

Here, a code table R1 is constituted by the arrangement Arun of the runvalues (Run) and the arrangement Cb1 of codes (code words) in the casewhere the number of uncoded zero coefficients is one, and this codetable R1 shows correspondences between the run value (Run) and the codein the case where the number of uncoded zero coefficients is one.Similarly, code tables R2, R3, R4, R5, R6, and R7 are constituted by thearrangement Arun of the run values (Run), and the arrangements Cb2, Cb3,Cb4, Cb5, Cb6, and Cb7 of codes (code words) in the cases where thenumbers of uncoded zero coefficients are two, three, four, five, six,and seven, respectively, and show correspondence between the run value(Run) and the code in the cases where the numbers of uncoded zerocoefficients are two, three, four, five, six, and seven, respectively.Further, a code table R8 is constituted by the arrangement Arun of therun values (Run), and the arrangement Cb8 of codes (code words) in thecase where the number of uncoded zero coefficients is eight or more, andshows correspondence between the run value (Run) and the code in thecase where the number of uncoded zero coefficients is eight or more.

Next, its operation will be described.

In the image coding apparatus 101 according to the first embodiment, theblocking unit Blk, the frequency transformation unit Trans, and thequantization unit Q operate in the same manners as those in theconventional image coding apparatus 201 a (see FIG. 30) or image codingapparatus 201 b (see FIG. 34).

More specifically, when an image signal V in is inputted to the imagecoding apparatus 101 a, the blocking unit Blk divides the inputted imagesignal Vin in block units, to generate image signals (pixel valuecomponents) BlkS corresponding to respective blocks. The frequencytransformation unit Trans transforms the pixel value components BlkSinto frequency components TransS according to DCT (Discrete CosineTransformation) or Wavelet transformation. The quantization unit Qquantizes the frequency components TransS in a predeterminedquantization step on the basis of a quantization parameter QP to outputquantized components QS, as well as outputs the quantization parameterQP. The run-length encoding unit RLE1 subjects the quantized componentsQS to a variable length coding process, and outputs a coded stream Str1.

Hereinafter, the operation of the run-length encoding unit RLE1 will bespecifically described.

The zigzag scanner Scan carries out zigzag scanning of the quantizedcomponents QS which are outputted from the quantization unit Q (i.e.,plural quantized coefficients Q1 to Q16 in a two-dimensional array asshown in FIG. 3( a)), to transform the quantized components QS intoquantized coefficients Coef. Here, the zigzag scanning of the quantizedcomponents QS is carried out by scanning the plural quantized componentsQ1 to Q16 in a two-dimensional array as shown in FIG. 3( a) along acourse indicated by the arrows A1 to A15 in FIG. 3( b), to transform thearray of the plural quantized coefficients Q1 to Q16 into aone-dimensional array (processing order) as shown in FIG. 3( c). Here,FIG. 3( d) shows an arrangement of concrete numerical values of theplural quantized coefficients Q1 to Q16 which has been subjected to thezigzag scanning (20, −10, 5, 0, 2, 0, 0, 0, 1, 0, 0, 0, −1, 0, 0, 1).

The run calculator RunCal calculates the number of successive zerocoefficients on the basis of the quantized components Coef which areoutputted from the zigzag scanner Scan, and outputs a run value Runindicating the calculated number. FIG. 3( e) shows specific run valueswhich are successively outputted from the run calculator RunCal,according to an order in which the run values are outputted: (0, 0, 0,1, 3, 3, 2). On the other hand, the level calculator LevCal calculates avalue of a non-zero coefficient following the successive zerocoefficients on the basis of the quantized components Coef outputtedfrom the zigzag scanner Scan, and outputs a level value Lev indicatingthe calculated value. FIG. 3( e) shows specific level values which aresuccessively outputted from the level calculator LevCal, according to anorder in which the level values are outputted: (20, −10, 5, 2, 1, −1,1).

The reordering unit Rreodr reorders the run values which havesuccessively been outputted from the run calculator RunCal in a reverseorder to how the run values have been outputted. FIG. 3( f) shows achanged order of the specific run values which have been reordered bythe reordering unit Rreodr: (2, 3, 3, 1, 0, 0, 0). The number calculatorNumClc calculates the number of uncoded coefficients on the basis of therun values Run which are outputted from the run calculator RunCal, andoutputs the calculated number of uncoded coefficients (hereinafter, alsoreferred to as uncoded coefficient number) Cnum. On the other hand, thereordering unit Lreodr reorders the level values which have successivelybeen outputted from the level calculator LevCal in a reverse order tohow the level values have been outputted. FIG. 3( f) shows a changeorder of the specific level values which have been reordered by thereordering unit Lreodr: (1, −1, 1, 2, 5, −10, 20).

The variable length coder RVLC subjects the run values RORun which havebeen reordered as the output from the reordering unit Rreodr, to avariable length coding process for assigning codes (code words) to therun values RORun with using plural code tables indicatingcorrespondences between the run value and the code (code word), on thebasis of the uncoded zero coefficient number Cum outputted from thenumber calculator NumClc, and outputs a run value code string RStr. Onthe other hand, the variable length coder LVLC subjects the level valuesROLev which have been reordered as the output from the reordering unitLreodr to a variable length coding process for assigning codes (codewords) to the level values ROL, by using plural code tables indicatingcorrespondences between the level value and the code (code word) on thebasis the quantization parameter QP from the quantization unit Q and aselection signal VlcSel from the outside instructing selection ofvariable length coding, and outputs a level value code string LStr.

Then, the multiplexer MUX multiplexes the level value code string Lstrand the run value code string Rstr, block by block, and outputs amultiplexed coded stream Str1.

Here, the process for multiplexing the level value code string LStr andthe run value code string RStr is carried out block by block, forexample, in such manner that the code string RStr corresponding to allrun values of a target block is followed by the code string LStrcorresponding to all level values of the target block, or the codestring LStr corresponding to all level values of the target block isfollowed by the code string RStr corresponding to all run values of thetarget block.

Hereinafter, the operation of the variable length coder LVLC will bespecifically described with reference to FIGS. 4( a) and 4(b).

The variable length coder LVLC obtains the quantization parameter QPfrom the quantization unit Q (step Sa1), and determines whether thevalue of the obtained quantization parameter QP is equal to or largerthan a threshold of the quantization parameter QP, which is held in thevariable length coder LVLC (step Sa2).

When a result of this determination indicates that the value of theobtained quantization parameter QP is smaller than the threshold of thequantization parameter QP, the variable length coder LVLC selects thecode table L1 that is constituted by the arrangement Alev of levelvalues and the arrangement Ca1 of codes (code words) (see FIG. 4( b))(step Sa3), while when the value of the obtained quantization parameterQP is equal to or larger than the threshold of the quantizationparameter QP, selecting the code table L2 that is constituted by thearrangement Alev of level values and the arrangement Ca2 of codes (codewords) (see FIG. 4( b)) (step Sa4).

Then, the variable length coder LVLC determines whether there is anyuncoded level value Lev in a target block (step Sa5) When a uncodedlevel value Levis included in the target block, the variable lengthcoder LVLC carries out a process for coding the level value using theselected code table, i.e., a process for assigning a corresponding codeto the level value (step Sa6), and thereafter carries out the process ofstep Sa5. On the other hand, when the result of the decision in step Sa5indicates that there is no uncoded level value Lev in the target block,the variable length coder LVLC finishes the variable length codingprocess for the level values Lev.

Here, when the VLC selection signal VlcSel previously designates avariable length coding process using a specific code table, the variablelength coder LVLC carries out a variable length coding process for thelevel values by using the specific code table, regardless of the valueof the quantization parameter QP.

Next, the operation of the variable length coder RVLC will bespecifically described with reference to FIGS. 5( a) and 5(b).

The variable length coder RVLC determines whether there is any uncodednon-zero coefficient in the target block on the basis of the output (thenumber of uncoded coefficients) Cnum from the number calculator NumClc(step Sb1). When a result of the determination indicates that there is auncoded non-zero coefficient, the variable length coder RVLC calculatesthe number of uncoded zero coefficients in the target block on the basisof the output Cnum from the number calculator NumClc (step Sb2).

Then, the variable length coder RVLC selects a code table according tothe calculated number of uncoded zero coefficients (step Sb3). To bemore specific, the variable length coder RVLC selects the code table R1that is constituted by the arrangement Arun of run values and thearrangement Cb1 of codes (code words) (see FIG. 5( b)) when the numberof uncoded zero coefficients is one. Similarly, the variable lengthcoder RVLC selects the code table R2 when the number of uncoded zerocoefficients is two, the code table R3 when the number of thecoefficients is three, and the code table R4 when the number of thecoefficients is four. Further, the variable length coder RVLC selectsthe code table R5 when the number of the uncoded zero coefficients isfive, the code table R6 when the number of the coefficients is six, andthe code table R7 when the number of the coefficients is seven,respectively. Further, when the number of uncoded zero coefficients iseight or more, the variable length coder RVLC selects the code table R8.

Next, the variable length coder RVLC carries out a process for codingrun values Run using the selected code table, i.e., a process forassigning corresponding codes to the run values (step Sb4), and thencarries out the determination process of step Sb1.

Here, when the result of the determination in step Sb1 indicates thatthere is no uncoded non-zero coefficient, the variable length coder RVLCfinishes the variable length coding process for the run values.

Next, a specific example in which a code table is selected on the basisof the quantization parameter in the variable length coding of the levelvalues as described above, thereby to increase a coding efficiency willbe described.

FIGS. 6( a) and 6(b) show the total number of bits corresponding tocodes which are assigned to level values when the quantization parameterQP is relatively smaller, i.e., when outputs (level values) from thelevel calculator LevCal which have been reordered and are outputted fromthe reordering unit Lreodr are 1, −1, 1, 2, 5, −10, 20 as shown in FIG.3( f).

When the quantization parameter QP is determined to be equal to orlarger than a threshold and the code table L2 is employed, codes(codewords) are assigned to respective level values as shown in FIG. 6(a), and the total number of bits corresponding to the assigned codes is75 bits.

On the other hand, when the quantization parameter QP is determined tobe smaller than the threshold and the code table L1 is employed, codes(code words) are assigned to respective level values as shown in FIG. 6(b), and the total number of bits corresponding to the assigned codes is47 bits.

When the quantization parameter QP is relatively smaller, the frequencyof occurrence of quantized components having larger values is higher.Thus, it is effective to select the code table L1 in which shorter codesare made correspond on average also to level values whose absolutevalues are relatively larger as compared to the code table L2 toincrease the coding efficiency.

FIGS. 7( a) and 7(b) show the total number of bits corresponding tocodes which are assigned to level values when the quantization parameterQP is relatively larger, i.e., when outputs (level values) from thelevel calculator LevCal which have been reordered and are outputted fromthe reordering unit Lreodr are 1, −1, 1, 1, 1, −2, 3, unlike in the caseshown in FIG. 3( f).

When it is determined that the quantization parameter QP is equal to orlarger than the threshold and the code table L2 is employed, codes (codewords) are assigned to respective level values as shown in FIG. 7( a),and the total number of bits corresponding to the assigned codes is 15bits.

On the other hand, when it is determined that the quantization parameterQP is smaller than the threshold and the code table L1 is employed,codes (code words) are assigned to the respective level values as shownin FIG. 7( b), and the total number of bits corresponding to theassigned codes is 17 bits.

As described above, when the value of the quantization parameter QP isrelatively larger, the frequency of occurrence of quantizationcoefficients having larger values is lower. Thus, it is effective toselect the code table L2 in which shorter codes are made intensivelycorrespond to level values whose absolute values are relatively smalleras compared to the code table L1, to increase the coding efficiency.

FIGS. 8( a)–8(c) show the total number of bits corresponding to codeswhich are assigned to run values outputted from the run calculatorRunCal when the run values are 0, 0, 0, 1, 3, 3, 2 as shown in FIG. 3(e).

When the reordering of run values as in the run-length encoding unitRLE1 and the change of the code table is not performed but the codetable R8 shown in FIG. 5( b) is always employed, codes (code words) areassigned to the respective run values as shown in FIG. 8( a), and thetotal number of bits corresponding to the assigned code is 21 bits.

When the reordering of run values and the change of the code tableaccording to the number of uncoded zero coefficients is performed as inthe run-length encoding unit RLE1, codes (code words) are assigned tothe respective run values as shown in FIG. 8( b), and the total numberof bits corresponding to the assigned codes is 13 bits. Here, every timea code is assigned to a run value, the number of uncoded coefficients isreduced by a value that is obtained by adding one to a run value thathas been coded immediately before. This is because a single orsuccessive zero coefficients are always followed by one non-zerocoefficient. In addition, the number of uncoded zero coefficientsobtained from plural reordered run values corresponding to one block,which are outputted from the reordering unit Rreodr, is 15. This isbecause a block to be processed always has at least one non-zerocoefficient.

When the reordering of run values like in the run-length encoding unitRLE1 is not performed but only the change of the code table according tothe number of uncoded zero coefficients is performed, codes (code words)are assigned to the respective run values as shown in FIG. 8( c), andthe total number of bits corresponding to the assigned codes is 20 bits.

As described above, the image coding apparatus 101 according to thefirst embodiment includes the run-length encoding unit RLE1 that encodesquantized coefficients which are obtained by quantizing frequencycomponents of an image signal, using a run value Run indicating thenumber of successive quantized components whose values are zero (zerocoefficients) Coef and a level value Lev indicating a value of aquantized component Coef whose value is not zero (non-zero coefficient),following the zero coefficients. Therefore, the quantized coefficientscan be coded at a higher coding efficiency, with its redundantinformation being removed.

Further, the run-length encoding unit RLE1 according to the firstembodiment includes the variable length coder LVLC that selects a codetable according to the value of the quantization parameter QP andcarries out a variable length coding of level values by using theselected code table, thereby reducing the total number of bitscorresponding to codes which are assigned to the level values. Therun-length encoding unit RLE1 further includes the reordering unitRreodr that reorders plural run values which are obtained from quantizedcoefficients to which a predetermined processing order has been given,from high frequency component to low frequency component; and thevariable length coder RVLC that selects a code table according to thenumber of uncoded zero coefficients in the target block, and carries outvariable length coding of the reordered run values using the selectedcode table. Therefore, the total number of bits corresponding to codeswhich are assigned to the run values is effectively reduced, therebyincreasing the coding efficiency.

In this first embodiment, the variable length coder RVLC selects a codetable according to the number of uncoded zero coefficients in the targetblock (i.e., the output Cnum from the number calculator NumClc).However, the variable length coder RVLC may select a code table on thebasis of not only the output Cnum from the number calculator NumClc butalso the VLC selection signal VlcSel. For example, when a variablelength coding process using a specific code table is previouslyindicated by the VLC selection signal VlcSel, the variable length coderRVLC carries out a variable length coding process for the run value byusing the specific code table, regardless of the number of uncoded zerocoefficients in the target block.

[Embodiment] 2

FIG. 9 is a block diagram for explaining an image decoding apparatusaccording to a second embodiment of the present invention.

This image decoding apparatus 102 according to the second embodimentdecodes, for example, the coded stream Str1 that is outputted from theimage coding apparatus 101 of the first embodiment.

The image decoding apparatus 102 has, in place of the run-lengthdecoding unit RLD0 b in the conventional image decoding apparatus 202 bshown in FIG. 36 which subjects an inputted coded stream Str0 b to avariable length decoding process, a run-length decoding unit RLD1 thatsubjects the inputted coded stream Str1 to a variable length decodingprocess on the basis of the quantization parameter QP and a VLDselection signal VldSel, to reconstitute quantized coefficients. Theconstruction except for the run-length decoding unit RLD1 is the same asthat of the image decoding apparatus 202 b as shown in FIG. 36.

FIG. 10 is a block diagram for explaining a specific construction of therun-length decoding unit RLD1.

The run-length decoding unit RLD1 has a demultiplexer DMUX fordemultiplexing the multiplexed coded stream Str1 that is outputted fromthe image coding apparatus 101 to obtain a code string LStrcorresponding to level values and a code string RStr corresponding torun values, as the conventional run-length decoding unit RLD0 b as shownin FIG. 37.

The run-length decoding unit RLD1 has a variable length decoder LVLD forsubjecting a level value code string LStr which is obtained bydemultiplexing the multiplexed coded stream Str1 to a variable lengthdecoding process on the basis of the quantization parameter QP and theVLD selection signal VldSel, to reconstitute level values ROLev; and avariable length decoder RVLD for subjecting a run value code string RStrwhich is obtained by demultiplexing the multiplexed coded stream Str1 toa variable length decoding process on the basis of the number ofundecoded coefficients to reconstitute run values RORun.

The run-length decoding unit RLD1 further includes an inverse reorderingunit LIreodr that reorders the level values ROLev outputted from thevariable length decoder LVLD in a reverse order to that of thereordering unit Lreodr on the coding end to reconstitute the outputs Levfrom the level calculator on the coding end; an inverse reordering unitRIreodr that reorders the run values RORun outputted from the variablelength decoder RVLD in a reverse order to that of the reordering unitRreodr on the coding end to reconstitute the outputs Run from the runcalculator on the coding end; and a number calculator NumClc thatcalculates the number Cnum of undecoded coefficients in a target blockon the basis of the outputs Run from the inverse reordering unit RIreodrand outputs the obtained number.

The run-length decoding unit RLD1 further includes an inverse zigzagscanner IScan that reconstitutes decoded quantized components DQS in atwo-dimensional array from decoded quantized components in aone-dimensional array, which are represented by the level values Lev andthe run values Run.

FIGS. 11( a) and 11(b) are diagrams for explaining a variable lengthdecoding process by the variable length decoder LVLD. FIG. 11( a) is aflowchart for explaining the variable length decoding process forreconstituting level values, and FIG. 11( b) is an explanatory diagramshowing a code table that is employed in the variable length decodingprocess. Here, code tables L1 and L2 which are employed in the variablelength decoding process for the level values are the same as the codetables L1 and L2 which are employed in the coding process for the levelvalues in the run-length encoding unit RLE1 according to the firstembodiment.

FIGS. 12( a) and 12(b) are diagrams for explaining a variable lengthdecoding process by the variable length decoder RVLD. FIG. 12( a) is aflowchart for explaining a variable length decoding process forreconstituting run values. FIG. 12( b) is an explanatory diagram showingcode tables which are employed in the variable length decoding process.Here, code tables R1 to R8 which are employed in the variable lengthdecoding process for run values are the same as the code tables R1 toR8, respectively, which are employed in the coding process for runvalues in the run-length encoding unit RLE1 according to the firstembodiment.

Next, its operation will be described.

When a multiplexed coded stream Str1 is for example inputted to theimage decoding apparatus 102 from the image coding apparatus 101according to the first embodiment, the run-length decoding unit RLD1subjects the coded stream Str1 to a decoding process and outputs decodedquantized components DQS. The operation of the run-length decoding unitRLD1 is an inverse to that of the run-length encoding unit RLE1.

To be more specific, in the run-length decoding unit RLD1, thedemultiplexer DMUX demultiplexes the inputted multiplexed coded streamStr1 to obtain a level value code string LStr corresponding to levelvalues and a run value code string RStr corresponding to run values, andoutputs the level value code string and the run value code string to thevariable length decoder LVLD and the variable length decoder RVLD,respectively.

The variable length decoder LVLD obtains level values ROLevcorresponding to respective codes (code words) for the level value codestring LStr obtained from the demultiplexer DMUX, by using plural codetables which indicate correspondences between the level value and thecode (code word), on the basis of the quantization parameter QP from thequantization unit Q and a VLD selection signal VldSel from the outsideinstructing selection of variable length decoding, and outputs theobtained level values to the inverse reordering unit LIreodr. On theother hand, the variable length decoder RVLD obtains run values ROLevcorresponding to respective codes (code words) for the run value codestring RStr obtained from the demultiplexer DMUX, by using plural codetables which indicate correspondences between the run value and the code(code words, on the basis of the number Cnum of undecoded coefficientsoutputted from the number calculator NumClc, and outputs the obtainedrun values to the inverse reordering unit RIreodr.

The inverse reordering unit LIreodr subject the level values ROLevoutputted from the variable length decoder LVLD to an inversearrangement process to the process by the reordering unit Lreodr on thecoding end, to reconstitute the outputs Lev from the level calculator onthe coding end. On the other hand, the inverse reordering unit RIreodrsubjects the run values RORun outputted from the variable length decoderRVLD to an arrangement process that is an inverse to the process of thereordering unit Rreodr on the coding end, to reconstitute the outputsRun from the run calculator on the coding end. Further, the numbercalculator NumClc calculates the number Cnum of undecoded coefficientsin a target block on the basis of the outputs Run from the inversereordering unit RIreodr, and outputs the obtained number Cnum to thevariable length decoder RVLD.

Then, the inverse zigzag scanner IScan carries out an operation that isan inverse to that of the zigzag scanner Scan to reconstitute decodedquantized components DQS in a two-dimensional array from the quantizedcomponents in a one-dimensional array, which are represented by thelevel values Lev and the run values Run, and outputs the obtainedquantized components DQS to the inverse quantization unit IQ.

Hereinafter, the operation of the variable length decoder LVLD will bespecifically described with reference to FIGS. 11( a) and 11(b).

The variable length decoder LVLD obtains the quantization parameter QPfrom the quantization unit Q of the image coding apparatus 101 (stepSc1), and determines whether the obtained quantization parameter QP isequal to or larger than a threshold of the quantization parameter QP,which is held in the variable length decoder LVLD (step Sc2).

When the result of the determination indicates that the obtainedquantization parameter QP is smaller than the threshold of thequantization parameter QP, the variable length decoder LVLD selects thecode table L1 (see FIG. 11( b)) that is constituted by the arrangementAlev of level values and the arrangement Ca1 of codes (code words) (stepSc3), and when the obtained quantization parameter QP is equal to orlarger than the threshold of the quantization parameter QP, selects thecode table L2 (see FIG. 11( b)) that is constituted by the arrangementAlev of level values and the arrangement Ca2 of codes (code words) (seeFIG. 11( b)) (step Sc4).

Thereafter, the variable length decoder LVLD determined whether there isany undecoded level value Lev in the target block (step Sc5). Whenundecoded level values Lev are included in the target block, thevariable length decoder carries out a decoding process forreconstituting level values Lev by using the selected code table, i.e.,a process for obtaining level values corresponding to codes (step Sc6),and then carries out the above-mentioned process of step Sc5. On theother hand, the result of the determination in step Sc5 indicates thatthere is no undecoded level value Lev in the target bloc, the variablelength decoder finished the variable length decoding process forreconstituting the level values Lev.

Here, when the LVD selection signal VldSel previously designates avariable length decoding process using a specific code table, thevariable length decoder LVLD carries out a variable length decodingprocess for reconstituting level values by using the specific codetable, regardless of the value of the quantization parameter QP.

Next, the operation of the variable length decoder RVLD will bespecifically described with reference to FIGS. 12.

The variable length decoder RVLD determines whether there is anyundecoded non-zero coefficients in a target block on the basis of theoutput (the number of undecoded coefficients) Cnum from the numbercalculator NumClc (step Sd1). When the result of the determination showsthat there are undecoded non-zero coefficients, the variable lengthdecoder calculates the number of undecoded zero coefficients in thetarget block on the basis of the number Cnum of the undecodedcoefficients (step Sd2).

The variable length decoder RVLD selects a code table according to theobtained number of undecoded zero coefficients (step Sd3). To be morespecific, when the number of undecoded zero coefficients is one, thevariable length decoder selects the code table R1 that is constituted bythe arrangement Arun of run values and the arrangement Cb1 of codes(code words) (see FIG. 12( b)). Similarly, the variable length decoderselects the code table R2 when the number of undecoded zero coefficientsis two, the code table R3 when the number of undecoded zero coefficientsis three, and the code table R4 when the number of undecoded zerocoefficients it four. Further, the variable length decoder selects thecode table R5 when the number of undecoded zero coefficients is five,the code table R6 when the number of undecoded zero coefficients is six,and the code table R7 when the number of undecoded zero coefficients isseven, respectively. Further, when the number of undecoded zerocoefficients is eight or more, the variable length decoder RVLD selectsthe code table R8.

Next, the variable length decoder RVLD carries out a decoding processfor reconstituting run values Run by using the selected code table,i.e., a process for obtaining run values corresponding to respectivecodes (step Sd4), and then carries out the above-mentioned determinationprocess of step Sd1.

Further, when the result of the determination in step Sd1 indicates thatthere is no undecoded non-zero coefficient, the variable-length decodeRVLD finishes the variable length decoding process for reconstitutingthe run values.

In this image decoding apparatus 102 according to the second embodiment,the inverse quantization unit IQ, the inverse frequency transformationunit ITrans, and the deblocking unit DeBlk operate in the same mannersas those in the conventional image decoding apparatus 202 a (see FIG.32) and image decoding apparatus 202 b (see FIG. 36).

To be more specific, the inverse quantization unit IQ carries out aninverse operation of the quantization unit Q, i.e., an operation ofinversely quantizing the decoded quantized components DQS with referringto the quantization parameter QP, to output decoded frequency componentsITransS. The inverse frequency transformation unit ITrans carries out aninverse operation of the frequency transformation unit Trans, i.e., anoperation of transforming the decoded frequency components ITransScorresponding to each block according to inverse DCT or inverse Wavelettransformation, to reconstitute decoded pixel value signals DBlkScorresponding to respective blocks. Then, the deblocking unit DeBlkintegrates the decoded pixel value components DBlkS of respectiveblocks, and outputs a decoded image signal Vout corresponding to eachpicture (frame).

As described above, the image decoding apparatus 102 according to thesecond embodiment includes the run-length decoding unit RLD1 thattransforms a run code string RStr and a level code string LStr whichconstitute coded data, respectively, into a run value Run indicating thenumber of successive zero coefficients Coef and a level value Levindicating a value of a non-zero coefficient following the zerocoefficients, to reconstitute quantized coefficients on the basis of therun value and the level value. Therefore, a decoding processcorresponding to a variable length coding process by which quantizedcoefficients can be coded at a higher coding efficiency with itsredundant information being removed can be satisfactory carried out.

In addition, the run-length decoding unit RLD1 according to the secondembodiment includes the variable length decoder LVLD that selects a codetable according to the value of the quantization parameter QP andcarries out variable length decoding for reconstituting level values byusing the selected code table. Therefore, a level value code string thatis composed of a reduced total number of bits corresponding to codeswhich are assigned to level values can be satisfactorily decoded.

The run-length decoding unit RLD1 further includes the variable lengthdecoder RVLD that selects a code table according to the number ofundecoded zero coefficients in a target block and decodes a code stringcorresponding to reordered run values by using the selected code table,and the inverse reordering unit RIreodr that reorders the run valueswhich are obtained by the decoding process in a reverse order to thereordering process for run values in the run-length encoding unit RLD1.Therefore, the total number of bits corresponding to codes which areassigned to the run values can be effectively reduced, and the run valuecode string comprising the run values can be satisfactorily decoded.

In this second embodiment, the variable length decoder RVLD selects acode table according to the number of undecoded zero coefficients in thetarget block (i.e., the output Cnum from the number calculator NumClc),but this variable length decoder RVLD may select the code table on thebasis of not only the output Cnum from the number calculator NumClc butalso the VLD selection signal VldSel. For example, when a variablelength decoding process using a specific code table is previouslyindicated by the VLD selection signal VldSel, the variable lengthdecoder RVLD performs a variable length decoding process by using thespecific code table to reconstitute run values, regardless of the numberof undecoded zero coefficients in the target block.

[Embodiment] 3

FIG. 13 is a block diagram for explaining an image coding apparatusaccording to a third embodiment of the present invention.

This image coding apparatus 103 according to the third embodiment has,in place of the run-length encoding unit RLE0 c in the image codingapparatus 201 c shown in FIG. 38 which subjects outputs (quantizedcomponents) QS from the quantization unit Q to a variable length codingprocess and outputs a coded stream Str0 c, a run-length encoding unitRLE2 that subjects the outputs QS from the quantization unit Q to avariable length coding process on the basis of a quantization parameterQP or a VLC selection signal VlcSel and outputs a coded stream Str2.Other components of the image coding apparatus 103 of the thirdembodiment are the same as those in the conventional image codingapparatus 201 c.

To be more specific, the run-length encoding unit RLE2 has, like theconventional run-length encoding unit RLE0 c, the first code table T1(see FIG. 42) that shows the correspondence between the pair of a runvalue and a level value (hereinafter, referred to as run-level pair) anda corresponding code, according to combinations of the run values andthe level values. This run-length encoding unit RLE2 regularly changesthe correspondences between the run-level pair and the code in the firstcode table, on the basis of the first code table, to form a second codetable having different correspondences from the first code table, andselects one of the first and second code tables on the basis of thequantization parameter QP that is outputted from the quantization unit Qor the VLC selection signal VlcSel from outside, as well as assignscodes to the run-level pairs associated with coefficients in the targetdata to be processed, on the basis of the selected code table.

Here, the quantization parameter QP is a parameter that indicates thevalue of the quantization step, and the quantization step isapproximately proportional to the quantization parameter QP. To be morespecific, when the quantization parameter QP is larger, the quantizationcomponents have smaller absolute values, then zero run in the quantizedcomponents (the length of successively continuing components whosevalues are zero) gets longer, and thus the level value has a smallerabsolute value. Therefore, in this case, a code table in which smallercodes are assigned to run-level pairs comprising larger run values andsmaller level values is selected, thereby to increase the codingefficiency. Conversely, when the quantization parameter QP is smaller,the quantized components have larger absolute values. Therefore, a codetable in which smaller codes are assigned to run-level pairs comprisingsmaller run values and larger level values is selected, therebyincreasing the coding efficiency.

Further, when the VLC selection signal VlcSel from the outside of theimage coding apparatus 103 is inputted, the run-length encoding unitRLE2 selects a code table that is employed in the coding process inaccordance with the selection signal VlcSel. Thus, when an appropriatecode table is selected from outside according to image characteristics(the value of motion of an image, the complexity of the motion, theminuteness of a pattern, or the like), or when a stream that can bedecoded by an image decoding apparatus including only one code table isformed on the side of the image coding apparatus 103, this image codingapparatus 103 can be controlled by the VLC selection signal VlcSel foralways using a predetermined code table. That is, it is also possible tocarry out a variable length coding process without changing a code tablebut using only one code table.

FIG. 14 is a block diagram for explaining a specific construction of therun-length encoding unit RLE2.

The run-length encoding unit RLE2 has, like the conventional run-lengthencoding unit RLE0 c (see FIG. 39), a zigzag scanner Scan fortransforming outputs (quantized components) QS in a two-dimensionalarray from the quantization unit Q into quantized components Coef in aone-dimensional array (i.e., predetermined order); a run calculatorRunCal for calculating the number of successive quantized componentswhose values are zero (zero coefficients) Coef and outputting a runvalue Run; and a level calculator LevCal for calculating a value of aquantized component whose value is not zero (non-zero coefficient) Coef,following the zero coefficients, and outputting a level value Lev.

In this third embodiment, the run-length encoding unit RLE2 further hasa run converter RunConv for carrying out a conversion process ofdividing the output (run value) Run from the run calculator RunCal intoa run value Run1 indicating an upper digit of the run value Run and arun value Run2 indicating a lower digit of the run value Run, on thebasis of the quantization parameter QP or the VLC selection signalVlcSel; and a level converter LevConv for carrying out a conversionprocess of dividing the output (level value) Lev from the levelcalculator LevCal into a level value Lev1 indicating an upper digit ofthe level value Lev and a level value Le2 indicating a lower digit ofthe level value Lev on the basis of the quantization parameter QP or theVLC selection signal VlcSel.

The run-length encoding unit RLE2 further includes a run-level encoderRunLevEnc for obtaining a code number Code corresponding to a pair ofthe run value Run1 and the level value Lev1 (hereinafter, referred to asa run-level upper digit pair) according to a code table or arithmeticoperation; and an reordering unit ReOdr for carrying out a process forreordering run-level upper digit pairs so that run-level upper digitpairs for higher frequency components, corresponding to an object blockto be processed, correspond to smaller code numbers on the basis ofcorrespondences between the run-level upper digit pair and code numberCode, in accordance with the quantization parameter QP or the VLCselection signal VlcSel, and outputting a code number ReOdrCodecorresponding to a reordered run-level upper digit pair.

The run-length encoding unit RLE2 further includes a position calculatorPosClc for calculating the number of coded quantized components (codedcoefficients) from the run value Run and outputting the number Pos ofthe coded coefficients; a code transformer CodeTrans for outputting acode number ExtCode corresponding to a run-level pair, indicated by asecond code table, from the level value Lev2 and the run value Run2, onthe basis of the correspondences between the run-level upper digit pairand the code number ReOdrCode; and a variable length coder VLC forassigning a bit string (code word) to the code number ExtCode togenerate a code string Str2.

The zigzag scanner Scan, the run calculator RunCal, the level calculatorLevCal, and the variable length coder VLC in the run-length encodingunit RLE2 are the same as those in the conventional run-length encodingunit RLE0 c as shown in FIG. 39.

Next, functions and effects will be described.

The zigzag scanner Scan transforms the quantized components QP in atwo-dimensional array into quantized components Coef in aone-dimensional array, i.e., to which an order is set. The runcalculator RunCal calculates the number of successive zero components(quantized components whose values are zero) Coef, and outputs a runvalue Run indicating the obtained number. The level calculator LevCalcalculates a value of a non-zero component (a quantized component whosevalue is not zero, following the zero components) Coef, and outputs alevel value Lev indicating the value of the non-zero component.

The run converter RunConv carries out a conversion process of dividingthe run value Run into the run value Run1 indicating an upper digit ofthe run value Run and the run value Run2 indicating a lower digit of therun value Run. The level converter LevConv carries out a conversionprocess of dividing the level value Lev into the level value Levlindicating an upper digit of the level value Lev and the level valueLev2 indicating a lower digit of the level value Lev.

The run-level encoder RunLevEnc obtains a code number Code correspondingto a pair of the level value Lev1 and the run value Run1 (run-levelupper digit pair) according to a code table (first code table) shown inFIG. 42 or arithmetic operation. The reordering unit ReOdr carries out aprocess of reordering the run-level upper digit pairs in accordance withthe quantization parameter QP or the VLC selection signal VlcSel, andoutputs a code number ReOdrCode corresponding to a reordered run-levelupper digit pair. According to the process of reordering the run-levelupper digit pairs, the correspondences between the run-level upper digitpair and the code number Code, which are obtained by the run-levelencoder RunLevEnc, are converted into correspondences in which smallercode numbers correspond to run-level upper digit pairs corresponding tohigher frequency components in the target block to be processed.

The position calculator PosClc calculates the number of coded componentsfrom the run value Run, and outputs the number Pos of codedcoefficients. The code transformer CodeTrans outputs a code numberExtCode corresponding to a run-level pair from the level value Lev2 andthe run value Run2, on the basis of the correspondences between therun-level upper digit pair and the code number ReOdrCode. At this time,the code transformer CodeTrans employs the number Pos of codedcoefficients which is outputted from the position calculator PosClc, toobtain the number of uncoded components.

Here, the code number ExtCode corresponding to the run-level pair, whichis outputted from the code transformer CodeTrans, is obtained on thebasis of the second code table which have different correspondencesbetween the run-level pair and the code number from those of the firstcode table. This second code table is formed as follows: a code tablethat has different correspondences between a run-level pair and a codenumber from the first code table is initially formed by the reorderingprocess by the reordering unit ReOdr, and then this code table formed bythe reordering unit ReOdr is modified by the number transformerCodeTrans on the basis of the number Pos of coded coefficients so as notto include correspondences between run-level pair and code number,corresponding to run values Run exceeding the number of uncodedcomponents.

The variable length coder VLC assigns a bit string (code word) to thecode number ExtCode to generate a coded stream Str2.

FIGS. 15( a) and 15(b) show examples of the second code table which isformed by the run-length encoding unit RLE2 on the basis of the firstcode table. Here, the first code table is the same as the code tableshown in FIG. 42, which is employed in the conventional run-lengthencoding unit RLE0 c. In the first and second code tables, a bit string(code word) is assigned to the code number in a one-to-one relationship,while it is needless to say that shorter code words are assigned to codenumbers Code having smaller values.

FIG. 15( a) shows, as an example of the second code table, a second codetable T2 a that is suitable for a case where the quantization parameterQP is smaller.

This second code table T2 a is formed as follows.

Initially, a value corresponding to ½ of the level Lev is assigned asthe level value Lev1, and an absolute value of (Lev1×2-Lev) is assignedas the level value Lev2.

Here, when the level value Lev is an odd number, a value that isobtained by dividing an even number having an absolute value which isone larger than that of the level value Lev, by 2 is employed as thelevel value Lev1. To be more specific, when the level value Lev ispositive, a value corresponding to ½ of (Lev+1) is assigned to the levelvalue Lev1, while when the level value Lev is negative, a valuecorresponding to ½ of (Lev−1) is assigned to the level value Lev1.

Then, a code number Code corresponding to a pair of the level value Lev1and the run value Run is obtained from the first code table (see FIG.42) according to the combinations of the level values Lev and the runvalue Run.

Further, the code number Code corresponding to a pair of the level valueLev1 and the run value Run is converted according to the next formula(1) when the Lev value is positive, and according to the formula (2)when the Lev value is negative. The second code table T2 a showscorrespondences between the code number and the run-level pair which areobtained by the above conversion.2×(Code−Lev2)−1  (1)2×(Code−Lev2)  (2)

For example, when focusing attention on a run-level pair (level=−2,run=1) in the code table (first code table) in FIG. 42, a code numberCode corresponding to this run-level pair is converted from “10”indicated by the first code table T1 in FIG. 42 into “1” indicated bythe second code table T2 a in FIG. 15( a).

That is, since the run-level pair (Lev, Run) is (−2, 1) in this case,Lev1 and Lev2 are calculated as follows.Lev1=Lev·(½)=−1Lev2=|Lev1 ·2−Lev|=|−1·2−(−2)|=0

Therefore, (Lev1, Run) is (−1, 1), and this run-level pair correspondsto a code number (Code=6) according to the first code table (see FIG.42).

Then, a code number corresponding to the run-level pair (Lev,Run)=(−2, 1) is calculated by employing the formula (2):2×(Code−Lev2)=2×(6−0)=12

The code table in FIG. 15( a) is characterized in that smaller codenumbers (i.e., shorter code words) are assigned to run-level pairscomprising smaller run values and larger level values as compared to thecode table (first code table) shown in FIG. 42, and this is suitable fora case where the quantization parameter QP is smaller.

FIG. 15( b) shows, as another example of the second code table, a secondcode table T2 b that is suitable for a case where the quantizationparameter QP is larger.

This second code table T2 b is formed as follows.

Initially, a value corresponding to ½ of the run value Run is assignedas the run value Run1, and an absolute value of (Run1×2-Run) is assignedas the run value Run2. Here, when the run value is an odd number, aninteger part of the value corresponding to ½ of (Run+1) is assigned tothe run value Run1.

Then, a code number Code corresponding to a pair of the level value Levand the run value Run1 is obtained from the first code table (see FIG.42), according to combinations of the level values Lev and the runvalues Run1.

Further, the code number Code corresponding to a pair of the level valueLev and the run value Run1 is converted on the basis of the next formula(3) when Lev value is positive, and the formula (4) when Lev value isnegative. The second code table T2 b shows correspondences between thecode number and the run-level pair which are obtained as a result of theconversion.2×(Code+Run2)−1  (3)2×(Code+Run2)−2  (4)

For example, when focusing attention on a run-level pair (level=−1,run=2) in the code table (first code table) of FIG. 42, a code numberCode corresponding to this run-level pair is converted from “12”indicated by the first code table T1 in FIG. 42 to “10” indicated by thesecond code table T2 b in FIG. 15( b).

To be more specific, since the run-level pair (Lev, Run) in this case is(−1, 2), Run1 and Run2 are calculated as follows.Run1=Run·(½)=1Run2=|Run1·2-Run1=|1·2−21=0

Therefore, (Lev, Run1) is (−1, 1), and this run-level pair correspondsto a code number (code=6) according to the first code table (FIG. 42).

Then, a code number corresponding to the run-level pair (Lev, Run)=(−1,2) is calculated by using the formula (4):2×(Code+Run2)=2×(6−0)−2=10

The second code table T2 b shown in FIG. 15( b) is characterized in thatsmaller code numbers (i.e., shorter code words) are assigned torun-level pairs comprising larger run values and smaller level values ascompared to the code table (first code table) T1 shown in FIG. 42, andthis is suitable for a case where the quantization parameter QP islarger.

FIGS. 16( a)–16(c) show other examples of the second code table that isformed on the basis of the first code table by the run-length encodingunit RLE2. Here, the first code table is the same as the code table T1shown in FIG. 42, which is employed in the conventional run-lengthencoding unit RLE0 c.

The number transformer CodeTrans calculates the number of uncodedcomponents (the number of coefficients which has not yet been subjectedto a coding process) in a target block to be processed, on the basis ofthe number Pos of coded-coefficients which is outputted from theposition calculator PosClc. Further, the second code table which isformed from the first code table is made include no code wordscorresponding to run-level pairs including run values exceeding thenumber of uncoded components. Thereby, coding at higher compressionefficiency is enabled.

FIG. 16( a) shows a second code table T2 c that is formed when thenumber of uncoded components is three or more. FIG. 16( b) shows asecond code table T2 d that is formed when the number of uncodedcomponents is two. FIG. 16( c) shows a second code table T2 e that isformed when the number of uncoded components is one.

When correspondences between run-level pairs including run values whichwill never be used and codes are deleted from the code table asdescribed above, a shorter code is assigned to the run-level pair. Forexample, according to the second code table T2 e as shown in FIG. 16(c), a run-level pair comprising a run value [0] and a level value [4]corresponds to a code number [7]. The run-level pair comprising the runvalue [0] and the level value [4] corresponds to a code number [11]according to the second code table T2 d shown in FIG. 16( b), while therun-level pair comprising the run value [0] and the level value [4]corresponds to a code number having a further larger value (not shown)according to the second code table T2 c shown in FIG. 16( a).

FIG. 17 shows an example of a coding order in the run-length encodingunit RLE2 of the image coding apparatus 103 according to the thirdembodiment.

Generally, absolute values of level values corresponding to lowerfrequency components are large and, in the code table, code numbers Codehaving larger values correspond to run-level pairs corresponding to thelower frequency components. On the contrary, absolute values of levelvalues corresponding to higher frequency components are small and, inthe code table, code numbers having smaller values correspond torun-level pairs corresponding to the higher frequency components.

As described with reference to FIGS. 16, the increase in the compressionefficiency, which is obtained by deleting code numbers (code words)corresponding to run-level pairs that include run values exceeding thenumber of uncoded components from the code table, gets larger as thenumber of uncoded components is smaller, as well as larger as theabsolute value of the level value is larger, because the ratio ofdecrease in the value of the assigned code number is larger as comparedto the case where the code numbers are not yet deleted.

Thus, when quantized components having larger absolute values of thelevel values and corresponding to lower frequency components are codedlater in the coding of quantized components by the run-length encodingunit RLE2, like in the image coding apparatus 103 according to the thirdembodiment, the compression efficiency is further increased.

To be more specific, the reordering unit ReOdr reorders quantizedcomponents so as to be successively arranged from a run-level pair of aquantized component corresponding to a higher frequency component (thelast non-zero component) to a run-level pair of a quantized componentcorresponding to a lower frequency component, as shown by arrows X1 toX7 in FIG. 17, to add an EOB indicating the last coded component in atarget block after a code word corresponding to a run-level pair of aquantized component having the lowest frequency component, therebyincreasing the compression efficiency.

Further, in the third embodiment, the quantization parameter QP and theVLC selection signal VlcSel are supplied to the level converter LevConv,the run converter RunConv, the reordering unit ReOdr, and the numbertransformer CodeTrans. Therefore, a code table can be changed accordingto the quantization parameter QP, or an appropriate code table can beselected from outside according to contents of an image (the value of amotion of the image, the complicity of the motion, or the minuteness ofa pattern).

For example, when the code table that is employed in the coding processis changed in accordance with the VLC selection signal VlcSel fromoutside of the image coding apparatus, the image decoding apparatus cancreate a stream that is decodable by a decoding unit having only onecode table.

In this third embodiment, the image coding apparatus 103 that encodesquantized coefficients of an image signal as a target data to beprocessed includes the run-length encoding unit RLE2 that assignsvariable-length codes to the quantized coefficient using a code table,and this run-length encoding unit RLE2 forms the second code table thatis optimized for the target data to be processed on the basis of thefirst code table, and selects one of the first and second code tables asa code table that is employed for the assignment of variable lengthcodes, on the basis of the quantization parameter QP or the VLCselection signal VlSel. Therefore, redundant information included in thetarget data can be removed effectively, thereby further increasing thecompression rate for image signals or the like.

In this third embodiment, the run-length encoding unit RLE2 includesvarious devices for increasing the compression rate, i.e., the runconverter RunConv, the level converter LevConv, the reordering unitReOdr, and the number transformer CodeTrans, as shown in FIG. 14.However, the run-length encoding unit RLE2 may include only some of thedevices for increasing the compression rate. In this case, therun-length encoding unit RLE2 can be easily mounted.

Further, in the third embodiment, the second code table is obtained bymodifying correspondences between the run-level pairs and the codenumbers in both parts constituting the first code table: a part whichcan be regularly generated by an arithmetic operation (regularly buildVLC), and a part which cannot be regularly generated (table look upVLC). However, when the first code table has the part which can beregularly generated by an arithmetic operation (regularly build VLC) andthe part which cannot be regularly generated (table loop up VLC), thesecond code table may be formed by modifying only the part as the partof the first code table, which can be regularly generated by anarithmetic whose operation is easily carried out. In this case, themounting of the run-length encoding unit RLE2 can be more easilyperformed.

According to this third embodiment, in the run-length encoding unit thatperforms variable length coding of quantized components by usingrun-level pairs, the quantized components are successively subjected tovariable length coding from high frequency component to low frequencycomponent. However, it goes without saying that in a run-length encodingunit that subjects run values and level values corresponding toquantized components in the target block separately to the variablelength coding process like in the first embodiment, the run values andthe level values corresponding to the quantized components in the targetblock may be subjected to variable length coding, successively from highfrequency component to low frequency component.

[Embodiment] 4

FIG. 18 is a block diagram for explaining an image decoding apparatusaccording to a fourth embodiment of the present invention.

This image decoding apparatus 104 according to the fourth embodimenthas, in place of the run-length decoding unit RLD0 c in the conventionalimage decoding apparatus 202 c as shown in FIG. 40 which subjects acoded stream Str0 c to a variable length decoding process and outputsdecoded quantized components DQS, a run-length decoding unit RLD2 thatsubjects a coded stream Str2 to a variable length decoding process onthe basis of the quantization parameter QP or a variable length decodingselection signal (VLD selection signal) VldSel and outputs decodedquantized components DQS. Other components of the image decodingapparatus 104 according to the fourth embodiment are the same as thosein the conventional image decoding apparatus 202 c.

To be more specific, the run-length decoding unit RLD2 has, like theconventional run-length decoding unit RLD0 c, a first code table T1 (seeFIG. 42) which indicates the correspondence between the pair of a runvalue and a level value (hereinafter, referred to as run-level pairs)and the corresponding code, according to combinations of the run valuesand the level values. Then, the run-length decoding unit RLD2 regularlychanges the correspondences between run-level pairs and codes in thefirst code table, on the basis of the first code table, to form a secondcode table having different correspondences from those of the first codetable, and selects one of the first and second code tables in accordancewith the quantization parameter QP outputted from the quantization unitQ or the VLD selection signal VldSel from outside, as well as transformscode words (bit string) that constitute the coded stream Str2 into pairsof run values and level values associated with coefficients in thetarget data to be processed, on the basis of the selected code table.

As described above, the quantization parameter QP is a parameterindicating the value of the quantization step, and the quantization stepis approximately proportional to the quantization parameter QP. To bemore specific, when the quantization parameter QP is larger, thequantized components have smaller absolute values, then zero run of thequantized components (the length of successively continuing componentswhose values are zero) gets longer, and thus level values have smallerabsolute values. In this case, accordingly, a code table in whichsmaller codes are assigned to run-level pairs comprising larger runvalues and smaller level values is selected, thereby to further improvea coding efficiency. Conversely, when the quantization parameter QP issmaller, the quantized components have absolute values, and thus a codetable in which smaller codes are assigned to run-level pairs comprisingsmaller run values and larger level values is selected, thereby toincrease the coding efficiency.

FIG. 19 is a block diagram illustrating a specific construction of therun-length decoding unit RLD2.

The run-length decoding unit RLD2 has, as the conventional run-lengthdecoding unit RLD0 c, a variable length decoder VLD, and this decoderVLD decodes the coded stream Str2 outputted from the image codingapparatus 103 according to the third embodiment and outputs a codenumber ExtCode.

In this fourth embodiment, the run-length decoding unit RLD2 has anumber inverse transformer ICodeTrans for carrying out a number inversetransformation process for dividing the code number ExtCode into a codenumber PrmCode corresponding to a run-level upper digit pair comprisinga level value Lev1 and a run value Run1, a level value Lev2, and a runvalue Run2 on the basis of the quantization parameter QP or the VLDselection signal VldSel; and an inverse reordering unit IReOdr forreordering plural code numbers PrmCode corresponding to a target blockto be processed in order of increasing frequency of run-level pair, andoutputting the plural code numbers Code which correspond to the targetblock and have a changed order.

The run-length decoding unit RLD2 further includes a run-level detectorRunLevDec for detecting a run-level pair corresponding to a code numberCode according to a code table or arithmetic operation, and outputting alevel value Lev1 and a run value Run1 constituting the run-level pair; arun inverse converter IRunConv for reconstituting a run value Run fromthe run value Run1 indicating the upper digit of the run value Run andthe Run value Run2 indicating the lower digit of the run value Run; anda level inverse converter ILevConv for reconstituting a level value Levfrom the level value Lev1 indicating the upper digit of the level valueLev and the level value Lev2 indicating the lower digit of the levelvalue Lev.

The run-length decoding unit RLD2 further include, as the conventionalrun-length decoding unit RLD0 c, an inverse zigzag scanner IScan. Thisscanner IScan transforms quantized components in a one-dimensionalarray, which are represented by the level values Lev and the run valuesRun, into decoded quantized components DQS in a two-dimensional array,and outputs the same.

Here, the variable length decoder VLD, the run-level detector RunLevDec,and the inverse zigzag scanner IScan in the run-length decoding unitRLD2 are the same as those in the run-length decoding unit RLD0 c shownin FIG. 41.

Next, functions and effects will be described.

In the run-length decoding unit RLD2, the variable length decoder VLDcarries out an inverse operation to that of the variable length coderVLC. That is, the variable length decoder VLD decodes the coded streamStr2 and outputs a code number ExtCode corresponding to a code word (bitstring) that constitutes the stream. The number inverse transformerICodeTrans carries out an inverse operation to that of the numbertransformer CodeTrans on the basis of the quantization parameter QP orthe VLD selection signal VldSel, to divide the code number ExtCode intoa code number PrmCode corresponding to a run-level upper digit paircomprising the level value Lev1 and the run value Run1, a level valueLev2, and a run value Run2.

The inverse reordering unit IReOdr carries out an inverse operation tothat of the reordering unit Reodr on the basis of the quantizationparameter QP or the VLD selection signal VldSel. Thereby, a process forreordering plural code numbers PrmCode corresponding to the target blockto be processed in order of increasing frequency of run-level pair iscarried out, and plural code numbers Code which have a changed order andcorrespond to the block are outputted. The run-level detector RunLevDecdetects a run-level pair corresponding to a code number Code accordingto a code table or arithmetic operation, and outputs the level valueLev1 and the run value Run1 constituting the detected run-level pair.

The run inverse converter IRunConv carries out an inverse operation tothat of the run converter RunConv on the basis of the quantizationparameter QP or the VLD selection signal VldSel, to reconstitute the runvalue Run from the run value Run 1 indicating the upper digit of the runvalue Run and the run value Run2 indicating the lower digit of the runvalue Run. Further, the level inverse converter ILevConv carries out aninverse operation to that of the level converter LevConv on the basis ofthe quantization parameter QP or the VLD selection signal VldSel, toreconstitute the level value Lev from the level value Levl indicatingthe upper digit of the level value Lev and the level value Lev2indicating the lower digit of the level value Lev.

Here, in the number inverse transformer IcodeTrans, the inversereordering unit IReOdr, the run inverse converter IRunConv and the levelinverse converter ILevConv, the selection of the first or second codetable is performed on the basis of the quantization parameter QP or theVLD selection signal VldSel, and the operations are carried outaccording to the selected code table.

The inverse zigzag scanner IScan carries out an inverse operation to theoperation of the zigzag scanner Scan, to transform quantized componentsin a one-dimensional array which are represented by the level values Levand the run values Run, into decoded quantized components DQS in atwo-dimensional array, on the basis of the level values Lev and the runvalues Run.

Further, when the VLD selection signal VldSel is inputted from outside,the run-length decoding unit RLD2 selects an appropriate code tablecorresponding to contents of an image (the value of a motion of theimage, the complicity of the motion, the minuteness of a pattern), whichis indicated by the VLD selection signal VldSel.

In this fourth embodiment, the quantization parameter QP and the VLDselection signal VldSel are supplied to the number inverse transformerICodeTrans, the inverse reordering unit IReOdr, the run inverseconverter IRunConv, and the level inverse converter IlevConv,respectively. Thus, a code table can be changed according to thequantization parameter QP, or an appropriate code table can be selectedfrom outside of the image decoding apparatus, according tocharacteristics of an image, i.e., the value of a motion of the image,the complexity of the motion, the minuteness of a pattern or the like.

As described above, in this fourth embodiment, the image decodingapparatus 104 that decodes coded data which are obtained byvariable-length-coding quantized coefficients of an image signalincludes the run-length decoding unit RLD2 for transforming a variablelength code into quantized components using a code table. Further, therun-length decoding unit RLD2 forms a second code table that isoptimized for the target data to be processed, on the basis of the firstcode table, and selects one of the first and second code tables as acode table that is employed in the conversion of a variable length codeinto quantized coefficients, in accordance with the quantizationparameter QP or the VLD selection signal VldSel. Therefore, a decodingprocess corresponding to a variable length coding process that caneffectively remove redundant information included in the target data tobe processed can be satisfactorily carried out.

In this fourth embodiment, as shown in FIG. 19, the run-length decodingunit RLD2 has various devices for increasing the compression rate, i.e.,the number inverse transformer ICodeTrans, the inverse reorderingunitIReOdr, the run inverse converter IRunConv, and the level inverseconverter ILevConv, while the run-length decoding unit RLD2 may has onlysome of these devices for increasing the compression rate. In this case,the run-length decoding unit RLD2 can be mounted more easily.

Further, in the fourth embodiment, the second code table is formed bychanging the correspondences between run-level pairs and code numbers inboth parts which constitute the first code table: the part that can beregularly generated by an arithmetic operation (regularly build VLC) andthe part that cannot be regularly generated (table look up VLC).However, when the first code table has the part that can be regularlygenerated by an arithmetic operation (regularly build VLC) and the partthat cannot be regularly generated (table loop up VLC), the second codetable may be formed by changing only the part as a part of the firstcode table, which can be regularly generated by the arithmetic whoseoperation is easily carried out. In this case, the mounting of therun-length decoding unit RLD2 can be performed more easily.

According to this fourth embodiment, in the run-length decoding unitthat performs variable length decoding of coded data corresponding toquantized components by using run-level pairs, the variable lengthdecoding of the coded data corresponding to the quantized components isperformed successively from high frequency component to low frequencycomponent. However, it is possible that, in a run-length decoding unitthat subjects coded data of run values and level values corresponding toquantized components in a target block separately to variable lengthdecoding as in the second embodiment, the coded data of run values andlevel values corresponding to the quantized components of the targetblock are subjected to the variable length decoding, successively fromhigh frequency component to low frequency component.

[Embodiment] 5

FIG. 20 is a block diagram for explaining an image coding apparatusaccording to a fifth embodiment of the present invention.

This image coding apparatus 105 include, in place of the run-lengthencoding unit RLE2 in the image coding apparatus 103 according to thethird embodiment as shown in FIG. 13, a run-length encoding unit RLE3that encodes a run-level pair as well as encode the number of non-zerocomponents, like the run-length encoding unit RLE2. Other components ofthe image coding apparatus 105 according to the fifth embodiment are thesame as those in the image coding apparatus 103 according to the thirdembodiment.

FIG. 21 shows a specific construction of the run-length encoding unitRLE3 in the image coding apparatus 105.

This run-length encoding unit RLE3 according to the fifth embodimenthas, in place of the position calculator PosClc in the run-lengthencoding unit RLE2 according to the third embodiment as shown in FIG.14, a non-zero coefficient counter NZcount for counting the number NZnumof non-zero coefficients on the basis of inputted quantized components,and a position calculator PosClc2 for calculating the number Pos2 ofcoded coefficients on the basis of the counted number Nznum of non-zerocoefficients and a run value Run calculated by the run calculatorRunCal.

The run-length encoding unit RLE3 according to the fifth embodimentencodes an output (code number) ExtCode from the number transformerCodeTrans as well as encodes the number NZnum of non-zero components,unlike the variable length coder VLC of the run-length encoding unitRLE2 according to the third embodiment.

Other components of the run-length encoding unit RLE3 are the same asthose of the run-length encoding unit RLE2 according to the thirdembodiment.

Next, functions and effects will be described.

Operations of the blocking unit Blk, the frequency transformation unitTrans, and the quantization unit Q in the image coding apparatus 105according to the fifth embodiment are the same as those in the imagecoding apparatus 103 according to the third embodiment. Further,operations of components other than the non-zero coefficient counterNZcount, the position calculator PosClc2, the number transformerCodeTrans, and the variable length coder VLC2 in the run-length encodingunit RLE3 according to the fifth embodiment, i.e., the scanner Scan, therun calculator RunCal, the level calculator LevCal, the run converterRunConv, the level converter LevConv, the run-level encoder RunLevEnc,and the reordering unit ReOdr are identical to those of the run-lengthencoding unit RLE2 according to the third embodiment. Thus, theoperations of the non-zero coefficient counter NZcount, the positioncalculator PosClc2, the number transformer CodeTrans, and the variablelength coder VLC2 will be hereinafter mainly described.

When quantized components QS outputted from the quantization unit Q areinputted to the run-length encoding unit RLE3, the non-zero coefficientcounter NZcount in the run-length encoding unit RLE3 counts the numberof non-zero components NZnum in the plural quantized componentscorresponding to respective blocks on the basis of the quantizedcomponents QS, and outputs the obtained number NZnum of non-zerocomponents to the position calculator PosClc2 and the variable lengthcoder VLC2.

The position calculator PosClc2 calculates a sum of the number of codedzero components and the number of non-zero components in a target blockon the basis of the number NZnum of non-zero components from thenon-zero coefficient counter NZcount and a run value Run from the runcalculator RunCal, and outputs the obtained value Pos2.

The number transformer CodeTrans outputs a code number ExtCodecorresponding to a run-level pair from a level value Lev2 and a runvalue Run2, on the basis of correspondences between the run-level upperdigit pairs and the code numbers ReOdrCode. At this time, the numbertransformer CodeTrans employs the calculated value Pos2 that isoutputted from the position calculator PosClc2 to obtain the number ofuncoded components in the target block.

Here, the code number ExtCode corresponding to a run-level pair, whichis outputted from the number transformer CodeTrans, is obtained on thebasis of the second code table having different correspondences betweenrun-level pairs and code numbers from the first code table. This secondtable is formed as follows: a code table having differentcorrespondences between run-level pairs and code numbers from the firstcode table is initially formed by the reordering process in thereordering unit ReOdr, and then the code table formed by the reorderingunit ReOdr is modified by the number transformer CodeTrans on the basisof the calculated value Pos2 so that run-level pairs having run valueswhich are larger than the maximum run value Run in the code tablecorrespond to code numbers ExtCode to which no codes are assigned.

The variable length coder VLC2 encodes the numberNZnum of non-zerocomponents, as well as performs coding for the code number ExtCode toassign a bit string (code word) to the code number ExtCode to generate acoded stream Str3.

Hereinafter, the operation of the variable length coder VLC2 will bespecifically described.

Unlike the variable length coder VLC according to the third embodiment,the variable length coder VLC2 according to the fifth embodiment notonly encodes the code number ExtCode corresponding to a run-level pairof a target block but also encodes the number NZnum of non-zerocomponents in the target block before coding the code number ExtCode ofthe block.

As described above, when the number NZnum of non-zero coefficients iscoded before coding the code number ExtCode of a block, the number NZnumof non-zero components of the target block can be initially decoded atthe decoding, and it can be checked that reconstitution of the lastrun-level pair in the target block has been completed, at a time whenthe run-level pairs corresponding to the number NZnum of non-zerocomponents have been reconstituted. Consequently, a specific value EOBthat is coded at the end of the target block (a value that istransmitted after the last non-zero component), which is required by thevariable length coder VLC according to the third embodiment, is notrequired by the variable length coder VLC2.

Next, the operations of the position calculator PosClc2 and the numbertransformer CodeTrans will be specifically described.

Assuming that a target block includes NBlock quantized components QS(including both of zero components and non-zero components), the maximumrun length (the maximum number of successively continuing zerocoefficients) is (NBlock−NZnum) on the basis of the number NZnum ofnon-zero coefficients in the target block. Further, the maximum runvalue (the maximum number of successively continuing zero coefficients)MaxRun(1) at a time when the coding of the first run-level pair has beencompleted is represented by the following formula (5), using a run valueFRun of the first run-level pair of the target block.MaxRun(1)=NBlock−NZnum−FRun  (5)

Generally, the maximum run value MaxRun(i) at a time when coding of ani-th run-level pair in a block has been completed is represented by thefollowing formula (6).MaxRun(i)=NBlock−NZnum−{the sum of 1st˜i-th run values}  (6)

Therefore, the position calculator PosClc2 outputs a calculated valuePos2 represented by the following formula (7), thereby indicating to thenumber transformer CodeTrans that the maximum run value MaxRun(i) is avalue represented by the formula (8).Pos2=NZnum+{the sum of 1th˜i-th run values}  (7)MaxRun(i)=NBlock−Pos2  (8)

The number transformer CodeTrans forms the second code table in whichcode numbers ExtCode to which no code is assigned are made correspond torun-level pairs having run values which are larger than the maximum runvalue MaxRun. Thereby, redundancy in the coding process due to theassignment of codes to run-level pairs which will never occur isdeleted, thereby increasing the compression rate.

When a variable-length code table that is composed of a first part whichcan be generated by an arithmetic operation (regularly build VLC) and asecond part which cannot be regularly generated by an arithmeticoperation (table look up VLC) is employed as the first and second codetables when the variable length coding process for the quantizedcomponents is carried out, the second code table may be formed bychanging both of the first and second parts in the first code tableaccording to the maximum run value, or the second code table may beformed by changing only the first part in the first code table, whichcan be generated by an arithmetic whose operation is easily performedaccording to the maximum run value.

Further, in place of changing the code table to one in which no code isassigned to run-level pairs having run values Run which are larger thanthe maximum run value MaxRun(i) when the variable length code table ischanged according to the maximum run value MaxRun(i) at a time when thecoding of an i-th run-level pair has been completed, a variable-lengthcode table may be directly changed to one in which no code is assignedto run-level pairs having run values Run that are larger than themaximum run value MaxRun(i).

FIGS. 24( a)–24(c) are diagrams showing examples of the variable lengthcode tables. In a code table Ta (FIG. 24( a)), shorter codes areassigned to smaller run values as compared to a code table Tb (FIG. 24(b)). In the code table Tb (FIG. 24( b)), further shorter codes areassigned to smaller run values as compared to a code table Tc (FIG. 24(c)).

In addition, in the code table Tc (FIG. 24( c)), shorter codes areassigned to level values having smaller absolute values as compared tothe code table Tb (FIG. 24( b). In the code table Tb, further shortercodes are assigned to level values having smaller absolute values ascompared to the code table Ta (FIG. 24( a)).

Therefore, it is preferable to select the code table Ta in FIG. 24( a)when the maximum run value MaxRun is smaller, the code table Tc in FIG.24( c) when the maximum run value MaxRun is larger, and the code tableTb in FIG. 24( b) when the maximum run value MaxRun is an intermediatevalue.

According to the fifth embodiment, the image coding apparatus 105 thatencodes quantized coefficients which are obtained by quantizingfrequency components of an image signal is provided with the run-lengthencoding unit RLE3 that assigns variable length codes to the quantizedcomponents using a code table. Then, the run-length encoding unit RLE3selects a code table in which run-level pairs which will never occur aredeleted on the basis of the sum of the number of processed coefficients(coded coefficients) in a target block to be coded and the number ofuncoded non-zero coefficients in the target block, in other words, thesum of the number of non-zero coefficients in the target block and thenumber of already-processed run values in the target block, therebyincreasing the variable length coding efficiency.

According to this fifth embodiment, in the run-length encoding unit thatperforms variable length coding of quantized components corresponding toeach block by using run-level pairs, the number NZnum of non-zerocomponents in a target block is coded. However, it is possible thatcoding of the number NZnum of non-zero components of a target block maybe performed in a run-length encoding unit that performs variable lengthcoding of run values and level values corresponding to quantizedcomponents of each block separately, as in the first embodiment. In thiscase, the maximum run value in the target block can be set at a valuethat is obtained by subtracting the number NZnum of non-zero componentsfrom the number of all components in the target block.

[Embodiment] 6

FIG. 22 is a block diagram for explaining an image decoding apparatusaccording to a sixth embodiment of the present invention.

This image decoding apparatus 106 according to the sixth embodiment has,in place of the run-length decoding unit RLD2 in the image decodingapparatus 104 according to the fourth embodiment as shown in FIG. 18, arun-length decoding unit RLD3 that performs a decoding process for codeddata to reconstitute the number of run-level pairs and the number ofnon-zero components in each block, as in the run-length decoding unitRLD2. Other components of the image decoding apparatus 106 according tothe sixth embodiment are the same as those in the image decodingapparatus 104 according to the fourth embodiment.

FIG. 23 shows a specific construction of the run-length decoding unitRLD3 in the image decoding apparatus 106.

This run-length decoding unit RLD3 of the sixth embodiment includes, inplace of the position calculator PosClc in the run-length decoding unitRLD2 according to the fourth embodiment as shown in FIG. 19, a positioncalculator PosClc2 for calculating the sum Pos2 of the number of decodedrun values in a target block to be decoded and the number NZnum ofnon-zero coefficients in the target block.

Further, a variable length decoder VLD2 of the run-length decoding unitRLD3 according to the sixth embodiment is different from the variablelength decoder VLD in the run-length decoding unit RLD2 according to thefourth embodiment in that a decoding process for reconstituting a codenumber ExtCode and a decoding process for reconstituting the codednumber NZnum of non-zero components are carried out.

Next, functions and effects will be described.

Operations of the inverse quantization unit IQ, the inverse frequencytransformation unit ITrans, and the deblocking unit DeBlk in the imagedecoding apparatus 106 according to the sixth embodiment are the same asthose in the image decoding apparatus 104 of the fourth embodiment.Further, operations of components of the run-length decoding unit RLD3according to the sixth embodiment other than the variable length decoderVLD2, the position calculator PosClc2 and the number inverse transformerIcodeTrans, i.e., the inverse reordering unit IReOdr, the run-leveldetector RunLevDec, the level inverse converter ILevConv, the runinverse converter IRunConv, and the inverse zigzag scanner IScan areidentical to those of the run-length decoding unit RLD2 according to thefourth embodiment. Therefore, operations of the variable length decoderVLD2, the position calculator PosClc2, and the number inversetransformer ICodeTrans will be hereinafter mainly described.

The variable length decoder VLD2 decodes the coded stream Str3, andoutputs a code number ExtCode corresponding to a code word (bit string)that composes the coded stream. The number inverse transformerICodeTrans carries out an inverse operation to that of the numbertransformer CodeTranson the basis of at least either the quantizationparameter QP or the VLD selection signal VldSel, and the sum Pos2 of thenumber of decoded coefficients and the number of undecoded non-zerocoefficients, to divide the code number ExtCode into a code numberPrmCode corresponding to the run-level upper digit pair comprising thelevel value Lev1 and the run value Run1, a level value Lev2, and a runvalue Run2.

The inverse reordering unit IReOdr, the run-level detector RunLevDec,the run inverse converter IRunConv, the level inverse converterILevConv, and the inverse zigzag scanner IScan performs the sameoperations as those in the fourth embodiment.

Here, the number inverse transformer ICodeTrans, the inverse reorderingunit IReOdr, the run inverse converter IRunConv, and the level inverseconverter ILevConv selects one of the first and second code tables onthe basis of at least either the quantization parameter QP or the VLDselection signal VldSel, and the sum Pos2 of coefficients, and performthe operations on the basis of the selected code table.

Hereinafter, the operation of the variable length decoder VLD2 will bespecifically described.

The variable length decoder VLD2 according to the sixth embodiment isdifferent from the variable length decoder VLD according to the fourthembodiment in that it decodes not only the code number ExtCodecorresponding to a run-level pair but also the coded number NZnum ofnon-zero components in the target block. When the number NZnum ofnon-zero components is obtained by the decoding, at a time when NZnumrun-level pairs have been decoded, this NZnum-th run-level pair isjudged to be the last run-level pair. Consequently, the variable lengthdecoder VLD2 does not require a value EOB that is required by thevariable length decoder VLD and is coded at the end of the target block.

For example, assuming that there are NBlock quantized components QS inthe target block, including zero components and non-zero components, themaximum run value (the maximum number of successively continuing zerocoefficients) is (NBlock−NZnum) on the basis of the number NZnum ofnon-zero coefficients in the target block. Further, the maximum runvalue (the maximum number of successively continuing zero coefficients)MaxRun(1) at a time when the decoding for reconstituting the firstrun-level pair has been performed is (NBlock−NZnum−FRun) as described inthe fifth embodiment.

Generally, the maximum run value MaxRun(i) at a time when decoding forreconstituting an i-th run-level pair in a block has been performed isobtained as follows:MaxRun(i)=Nblock−Nznum−{the sum of 1st˜i-th run values}

Therefore, the position calculator PosClc2 outputs the sum Pos2 ofcoefficients [=NZnum +{the sum of 1st˜i-th run values}], therebyindicating to the number transformer CodeTrans that the maximum runvalue at a time when the decoding for reconstituting an i-th run-levelpair has been performed is (NBlock-Pos2).

The number inverse transformer ICodeTrans employs a code table in whichno code is assigned to code numbers corresponding to run-level pairscomprising run values which are larger than the maximum run value Run,to obtain a code number ExtCode corresponding to a code, therebydecoding a code that is assigned to a code number according to codeassignment which avoids assignment of codes to run-level pairs whichwill never occur.

Here, when a variable length code table that is composed of the firstpart which can be generated by an arithmetic operation (regularly buildVLC) and the second part that cannot be regularly generated (table loopup VLC) is employed as the first and second code tables in the variablelength decoding process, the second code table may be formed by changingboth of the first and second parts in the first code table according tothe maximum run value, while the second code table may be formed bychanging only the first part of the first code table which can begenerated by an arithmetic whose operation is easily carried out,according to the maximum run value.

Further, when a variable length code table is changed according to themaximum run value MaxRun at a time when the decoding for reconstitutingan i-th run-level pair has been completed, the variable length codetable can be changed directly to the code table Ta in FIG. 24( a), thecode table Tb in FIG. 24( b), or the code table Tc in FIG. 24( c), inplace of changing the code table to one in which no code is assigned torun-level pairs comprising run values which are larger than the maximumrun value MaxRun.

For example, it is preferable to select the code table Ta in FIG. 24( a)when the maximum run value MaxRun is smaller, the code table Tc in FIG.24( c) when the maximum run value MaxRun is larger, and code table Tb inFIG. 24( b) when the maximum run value MaxRun is an intermediate value.

As described above, according to the sixth embodiment, the imagedecoding apparatus 106 that reconstitutes quantized coefficients whichare obtained by quantizing frequency components of an image signal by adecoding process for coded data is provided with the run-length decodingunit RLD3 for obtaining a quantized coefficient corresponding to avariable length code by employing a code table. Then, this run-lengthdecoding unit RLD3 selects a code table including no run-level pairswhich will never occur, on the basis of the sum of the number ofprocessed coefficients (decoded coefficients) in a target block and thenumber of undecoded non-zero coefficients in the target block.Therefore, a decoding process corresponding to a variable length codingprocess that can more effectively remove redundant information includedin the quantized coefficients to be processed can be satisfactorilycarried out.

According to this sixth embodiment, in the run-length decoding unit thatperforms variable length decoding for quantized components of each blockby using run-level pairs, the coded number NZnum of non-zero componentsin a target block is decoded. However, it is possible that, for example,in a run-length decoding unit that subjects run values and level valuescorresponding to quantized components of each block separately to thevariable length decoding process as in the second embodiment, the codednumber NZnum of non-zero components of the target block is decoded. Inthis case, it can be judged that the NZnum-th level value is the lastlevel value in the target block, at a time when NZnum level values havebeen decoded.

In any of the aforementioned embodiments, the code table is changedaccording to the quantization parameter QP, while the code table may bechanged according to another parameter. For example, another parametermay be newly derived and expressly switched for each block.

In the above-mentioned embodiments, as a method for subjectingcoefficients such as quantized components to a variable length coding(decoding) process, a method is shown in which a VLC table is employed,and the VLC table is changed on the basis of at least either informationabout processed coefficients which have been subjected to the coding(decoding) process, or a parameter relating to generation of thecoefficients. However, the method for variable-length coding (decoding)coefficients such as quantized components according to the presentinvention is not restricted to one using the VLC table. For example, themethod for variable-length coding the quantized components as describedin any of the first, third, and fifth embodiments may be a variablelength coding method in which the VLC table is not employed, and a codetable corresponding to the VLC table is changed on the basis of at leasteither the information about the processed coefficients, or theparameter relating to generation of the coefficients. Further, themethod for variable-length decoding the coded data corresponding to thequantized components according to any of the second, fourth, and sixthembodiments may be a variable length decoding method by which the VLCtable is not employed, and a code table corresponding to the VLC tableis changed on the basis of at least either the information about theprocessed coefficients, or the parameter relating to generation of thecoefficients.

The image coding apparatus that carries out a variable length codingprocess or the image decoding apparatus that carries out a variablelength decoding process according to any of the aforementionedembodiments is implemented by hardware, while these apparatuses may beimplemented by software. In this case, when a program for executing thevariable length coding or decoding process according to any of theaforementioned embodiments is recorded in a data storage medium such asa flexible disk, the image coding apparatus or the image decodingapparatus according to any of the aforementioned embodiments can beeasily implemented in an independent computer system.

FIGS. 25( a)–25(c) are diagrams for explaining a computer system forexecuting the variable length coding process according to the first,third or fifth embodiment, or the variable length decoding processaccording to the second, fourth, or sixth embodiment.

FIG. 25( a) shows a front view of a flexible disk FD which is a mediumthat contains a program employed in the computer system, across-sectional view thereof, and a flexible disk body D. FIG. 25( b)shows an example of a physical format of the flexible disk body D.

The flexible disk FD is composed of the flexible disk body D and a caseFC that contains the flexible disk body D. On the surface of the diskbody D, a plurality of tracks Tr are formed concentrically from theouter circumference of the disk toward the inner circumference. Eachtrack is divided into 16 sectors Se in the angular direction. Therefore,in the flexible disk FD containing the above-mentioned program, data ofthe program for executing the variable length coding process or thevariable length decoding process are recorded in the assigned storageareas (sectors) on the flexible disk body D.

FIG. 25( c) shows the structure for recording or reproducing the programin/from the flexible disk FD. When the program is recorded in theflexible disk FD, data of the program are written in the flexible diskFD from the computer system Cs through the flexible disk drive FDD. Whenthe above-mentioned image coding apparatus or image decoding apparatusis constructed in the computer system Cs by the program recorded in theflexible disk FD, the program is read from the flexible disk FD by theflexible disk drive FDD and then loaded to the computer system Cs.

Although in the above description a flexible disk is employed as astorage medium that contains a program for executing the variable lengthcoding process or the variable length decoding process, an optical diskmay be employed as the storage medium. Also in this case, the variablelength coding process or variable length decoding process can beperformed by software in like manner as the case of using the flexibledisk. The storage medium is not restricted to these disks, and anymedium may be employed as long as it can contain the program, forexample, a CD-ROM, a memory card, or a ROM cassette. Also when such datastorage medium is employed, the variable length coding or variablelength decoding process can be performed by the computer system in thesame manner as the case of using the flexible disk.

Applications of the image coding method or image decoding methodaccording to any of the aforementioned embodiments and systems using thesame will be described hereinafter.

FIG. 26 is a block diagram illustrating an entire construction of acontents provision system 1100 that performs contents distributionservices.

A communication service provision area is divided into regions (cells)of desired size, and base stations 1107 to 1110 which are each fixedradio stations are established in the respective cells.

In this contents provision system 1100, various devices such as acomputer 1111, a PDA (personal digital assistant) 1112, a camera 1113, aportable telephone 1114, and a portable telephone with a camera 1200 areconnected, for example, to the Internet 1101 through an Internet serviceprovider 1102, a telephone network 1104, and the base stations 1107 to1110.

However, the contents provision system 1100 is not restricted to asystem including all of the plural devices shown in FIG. 26, but may beone including some of the plural devices shown in FIG. 26. Further, therespective devices may be connected directly to the telephone network1104, not through the base stations 1107 to 1110 as the fixed radiostations.

The camera 1113 is a device that can take moving images of an object,like a digital video camera. The portable telephone may be a portabletelephone set according to any of PDC (Personal Digital Communications)system, CDMA (Code Division Multiple Access) system, W-CDMA(Wideband-Code Division Multiple Access) system, and GSM (Global Systemfor Mobile Communications) system, or PHS (Personal Handyphone System).

A streaming server 1103 is connected to the camera 1113 through the basestation 1109 and the telephone network 1104. In this system, livedistribution based on coded data which are transmitted by a user usingthe camera 1113 can be performed. The coding process for the data oftaken images may be carried out by either the camera 1113 or the serverthat transmits the data. Moving image data which are obtained by takingmoving images of an object by means of the camera 1116 may betransmitted to the streaming server 1103 through the computer 1111. Thecamera 1116 is a device that can take still images or moving images ofan object, such as a digital camera. In this case, coding of the movingimage data can be performed by either the camera 1116 or the computer1111. Further, the coding process is carried out by an LSI 1117 includedin the computer 1111 or the camera 1116.

Image coding or decoding software may be stored in a storage medium (aCD-ROM, a flexible disk, a hard disk, or the like) which is a recordingmedium that contains data readable by the computer 1111 or the like. Themoving image data may be transmitted through the portable telephone witha camera 1200. The moving image data are data which have been coded byan LSI included in the portable telephone 1200.

In this contents provision system 1100, contents corresponding to imagestaken by the user by means of the camera 1113 or the camera 1116 (forexample, live video of a music concert) are coded in the camera in thesame manner as any of the aforementioned embodiments, and transmittedfrom the camera to the streaming server 1103. The contents data aresubjected to streaming distribution from the streaming server 1103 to arequesting client.

The client may be any of the computer 1111, the PDA 1112, the camera1113, the portable telephone 1114 and the like, which can decode thecoded data.

In this contents provision system 1100, the coded data can be receivedand reproduced on the client side. When the data are received, decoded,and reproduced in real time on the client side, private broadcasting canbe realized.

The coding or decoding in the respective devices that constitute thissystem can be performed using the image coding apparatus or the imagedecoding apparatus according to any of the aforementioned embodiments.

A portable telephone will be now described as an example of the imagecoding or decoding apparatus.

FIG. 27 is a diagram illustrating a portable telephone 1200 that employsthe image coding method and the image decoding method according to anyof the aforementioned embodiments.

This portable telephone 1200 includes an antenna 1201 fortransmitting/receiving radio waves to/from the base station 1110, acamera unit 1203 that can take video or still images of an object, suchas a CCD camera, and a display unit 1202 such as a liquid crystaldisplay for displaying data of the video taken by the camera unit 1203or video received through the antenna 1201.

The portable telephone 1200 further includes a main body 1204 includingplural control keys, a voice output unit 1208 for outputting voices suchas a speaker, a voice input unit 1205 for inputting voices such as amicrophone, a storage medium 1207 for retaining coded data or decodeddata such as data of taken moving images or still images, or data,moving image data or still image data of received e-mails, and a slotunit 1206 which enables the storage medium 1207 to be attached to theportable telephone 1200.

The storage medium 1207 has a flash memory element as a type of EEPROM(Electrically Erasable and Programmable Read Only Memory) that is anelectrically programmable and erasable non-volatile memory contained ina plastic case, like a SD card.

The portable telephone 1200 will be described more specifically withreference to FIG. 28.

The portable telephone 1200 has a main control unit 1241 that performsgeneral control for the respective units of the main body including thedisplay unit 1202 and the control key 1204.

The portable telephone 1200 further includes a power supply circuit1240, an operation input control unit 1234, an image coding unit 1242, acamera interface unit 1233, a LCD (Liquid Crystal Display) control unit1232, an image decoding unit 1239, a multiplexing/demultiplexing unit1238, a recording/reproduction unit 1237, a modulation/demodulation unit1236, and an audio processing unit 1235. The respective units of theportable telephone 1200 are connected to each other via asynchronization bus 1250.

The power supply circuit 1240 supplies power from a battery pack to therespective units when a call end/power supply key is turned ON under thecontrol of a user, thereby activating the digital portable telephonewith a camera 1200 to be turned into an operable state.

In the portable telephone 1200, the respective units operate undercontrol of the main control unit 1241 that is constituted by a CPU, aROM, a RAM and the like. To be more specific, in the portable telephone1200, an audio signal that is obtained by voice inputting into the voiceinput unit 1205 in a voice communication mode is converted into digitalaudio data by the audio processing unit 1235. The digital audio data issubjected to a spectrum spread process by the modulation/demodulationcircuit 1236, further subjected to a DA conversion process and afrequency transformation process by the transmission/receiving circuit1231, and transmitted through the antenna 1201.

In this portable telephone set 1200, a signal received through theantenna 1201 in the voice communication mode is amplified, and thensubjected to a frequency transformation process and an AD conversionprocess. The received signal is further subjected to a spectrum inversespread process in the modulation/demodulation circuit 1236, convertedinto an analog audio signal by the audio processing unit 1235, and thisanalog audio signal is outputted through the voice output unit 1208.

When the portable telephone 1200 transmits an electronic mail in a datacommunication mode, text data of the e-mail that is inputted bymanipulation of the control key 1204 on the main body is transmitted tothe main control unit 1241 via the operation input control unit 1234.The main control unit 1241 controls the respective units so that thetext data is subjected to the spectrum spread process in themodulation/demodulation circuit 1236, then subjected to the DAconversion process and the frequency transformation process in thetransmission/receiving circuit 1231, and then transmitted to the basestation 1110 through the antenna 1201.

When this portable telephone 1200 transmits image data in the datacommunication mode, data of an image taken by the camera unit 1203 issupplied to the image coding unit 1242 via the camera interface unit1233. When the portable telephone 1200 does not transmit the image data,the data of the image taken by the camera unit 1203 can be displayeddirectly on the display unit 1202 via the camera interface unit 1233 andthe LCD control unit 1232.

The image coding unit 1242 includes the image coding apparatus accordingto any of the aforementioned embodiments. This image coding unit 1242compressively encodes the image data supplied from the camera unit 1203by the image coding method according to any of the above embodiments toconvert the same into coded image data, and outputs the obtained codedimage data to the multiplexing/demultiplexing unit 1238. At the sametime, the portable telephone 1200 transmits voices which are inputted tothe voice input unit 1205 while the image is being taken by the cameraunit 1203, as digital audio data, to the multiplexing/demultiplexingunit 1238 through the audio processing unit 1235.

The multiplexing/demultiplexing unit 1238 multiplexes the coded imagedata supplied from the image coding unit 1242 and the audio datasupplied from the audio processing unit 1235 by a predetermined method.Resultant multiplexed data is subjected to a spectrum spread process inthe modulation/demodulation circuit 1236, then further subjected to theDA conversion process and the frequency transformation process in thetransmission/receiving circuit 1231, and obtained data is transmittedthrough the antenna 1201.

When the portable telephone 1200 receives data of a moving image filethat is linked to a home page or the like in the data communicationmode, a signal received from the base station 1110 through the antenna1201 is subjected to a spectrum inverse spread process by themodulation/demodulation circuit 1236, and resultant multiplexed data istransmitted to the multiplexing/demultiplexing unit 1238.

When the multiplexed data that is received via the antenna 1201 isdecoded, the multiplexing/demultiplexing unit 1238 demultiplexes themultiplexed data to divide the data into a coded bit streamcorresponding to the image data and a coded bit stream corresponding tothe audio data, and the coded image data is supplied to the imagedecoding unit 1239 and the audio data is supplied to the audioprocessing unit 1235, via the synchronization bus 1250.

The image decoding unit 1239 includes the image decoding apparatusaccording to any of the aforementioned embodiments. The image decodingunit 1239 decodes the coded bit stream of the image data by the decodingmethod corresponding to the coding method according to any of theabove-mentioned embodiments, to reproduce moving image data, andsupplies the reproduced data to the display unit 1202 through the LCDcontrol unit 1232. Thereby, for example, the moving image data includedin the moving image file that is linked to the home page is displayed.At the same time, the audio processing unit 1235 converts the audio datainto an analog audio signal, and then supplies the analog audio signalto the voice output unit 1208. Thereby, for example, the audio dataincluded in the moving image file that is linked to the home page isreproduced.

Here, a system to which the image coding method and the image decodingmethod according to any of the aforementioned embodiments is applicableis not restricted to the above-mentioned contents provision system.

Recently, digital broadcasting using satellites or terrestrial waves istalked frequently, and the image coding apparatus and the image decodingapparatus according to the above embodiments is applicable also to adigital broadcasting system as shown in FIG. 29.

More specifically, a coded bit stream corresponding to video informationis transmitted from a broadcast station 1409 to a satellite 1410 such asa communication satellite or a broadcast satellite, via radiocommunication. When the broadcast satellite 1410 receives the coded bitstream corresponding to the video information, the satellite 1410outputs broadcasting waves, and these waves are received by an antenna1406 at home including satellite broadcast receiving facility. Forexample, an apparatus such as a television (receiver) 1401 or a set topbox (STB) 1407 decodes the coded bit stream, and reproduces the videoinformation.

Further, the image decoding apparatus according to any of theaforementioned embodiments can be mounted also on a reproductionapparatus 1403 that can read and decode the coded bit stream recorded ona storage medium 1402 such as a CD or a DVD (recording medium).

In this case, a reproduced video signal is displayed on a monitor 1404.The image decoding apparatus may be mounted on the set top box 1407 thatis connected to a cable for cable television 1405 or an antenna forsatellite/terrestrial broadcast 1406, to reproduce an output of theimage decoding apparatus to be displayed on a monitor 1408 of thetelevision. In this case, the image decoding apparatus may beincorporated not in the set top box but in the television. A vehicle1412 having an antenna 1411 can receive a signal from the satellite 1410or the base station 1107, and reproduce a moving image to display thesame on a display device of a car navigation system 1413 or the likewhich is mounted on the vehicle 1412.

Further, it is also possible that an image signal can be coded by theimage coding apparatus according to any of the aforementionedembodiments and recorded in a recording medium.

A specific example of a recording device is a recorder 1420 such as aDVD recorder that records image signals on a DVD disk 1421, and a diskrecorder that records image signals on a hard disk. The image signalsmay be recorded on a SD card 1422. Further, when the recorder 1420includes the image decoding apparatus according to any of theaforementioned embodiments, the image signals which are recorded on theDVD disk 1421 or the SD card 1422 can be reproduced by the recorder 1420and displayed on the monitor 1408.

Here, the structure of the car navigation system 1413 may include, forexample, the components of the portable telephone shown in FIG. 28 otherthan the camera unit 1203, the camera interface unit 1233 and the imagecoding unit 1242, and the same apply to the computer 1111, or thetelevision (receiver) 1401.

Further, as the terminal such as the portable telephone 1114, one ofthree types of terminals: a transmission-receiving type terminal havingboth of a coder and a decoder, a transmission terminal having only acoder, and a receiving terminal having only a decoder, can be mounted.

As described above, the image coding method or the image decoding methodaccording to any of the aforementioned embodiments is applicable to anyof the above-mentioned devices or systems, whereby the effects asdescribed in the above embodiments can be obtained.

Further, it goes without saying that the embodiments and theirapplications of the present invention are not restricted to those shownin this description.

INDUSTRIAL AVAILABILITY

The variable length coding method and the variable length decodingmethod according to the present invention effectively eliminatesredundant information included in coefficient data as a target of avariable length coding process, by selecting a code table adaptively tocharacteristics of coefficients that compose the coefficient data orstates of a coding process for the coefficients, thereby greatlyimproving a coding efficiency of a variable length coding process forimage signals or the like. These variable length coding method andvariable length decoding method are useful in data processing oftransmitting or storing moving image data.

1. A method for decoding a coded block image, the method comprising:decoding coded transform coefficients from a high frequency componenttoward a low frequency component, in accordance with information thatrepresents a total number of undecoded transform coefficients, to obtaindecoded transform coefficients, wherein the undecoded transformcoefficients are transform coefficients which have not been decoded;inverse scanning the decoded transform coefficients into atwo-dimensional array of transform coefficients; and inverse quantizingand inverse frequency transforming the two-dimensional array oftransform coefficients to obtain a reconstructed block image.
 2. Amethod for coding a block image, the method comprising: frequencytransforming a block image to obtain a plurality of transformcoefficients; scanning the plurality of transform coefficients to obtainscanned transform coefficients, wherein said scanning is performed froma low frequency component toward a high frequency component; andperforming variable-length coding on the scanned transform coefficientsfrom a high frequency component toward a low frequency component.
 3. Thecoding method of claim 2, wherein the variable-length coding isperformed on a block by block basis.
 4. The coding method of claim 2,wherein the variable-length coding is performed on quantized transformcoefficients.
 5. A method for decoding a coded block image, the methodcomprising: performing variable-length decoding on coded transformcoefficients from a high frequency component toward a low frequencycomponent to obtain decoded transform coefficients; inverse scanning thedecoded transform coefficients to obtain inverse-scanned transformcoefficients; and inverse frequency transforming the inverse-scannedtransform coefficients to obtain a block image.
 6. The decoding methodof claim 5, wherein the variable-length decoding is performed on a blockby block basis.
 7. The decoding method of claim 5, wherein the inversefrequency transforming is performed on inverse-quantized transformcoefficients.